p5.js中的错误:“ pushmatrix()未使用,请参见push();
每次我运行代码时,都会给我一个错误:
p5.js说:一个错误的错误“未使用pushmatrix()未使用,请参见push()”在p5JS库内发生pushmatrix时(在sketch.js [/sketch.js:175:13中的175行)时发生了错误。 ])
如果没有另行说明,则可能是传递给PushMatrix的参数的问题。 ( http://p5js.org/reference/#/p5/p5/p5/pushmatrix ))))) /p>
( , pushmatrix()
在我的代码中不存在。
当我尝试通过用 push()
pushmatrix()
替换 push()
来修复它时,它给了我相同的错误:
p5.js说:一个错误的错误“未使用pushmatrix()未使用,请参见push()”在p5JS库内发生pushmatrix时(在sketch.js [/sketch.js:175:13中的175行)时发生了错误。 ])
如果没有另行说明,则可能是传递给PushMatrix的参数的问题。 ( http://p5js.org/reference/#/p5/p5/p5/pushmatrix ))))) /p>
( http://p5js.org/reference/#/p5/p5/pushmatrix 代码: https://pastebin.com/gmxwvjla 这么大)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
简而言之:
pushmatrix()
不是p5
中的有效功能。它不存在。您想用push()
和popmatrix()
withpop()
。通过这些替换,您的代码无需任何错误就可以运行,我看到平方在画布的中心旋转。
错误消息并不特别有用,但是请查看澄清了很多事情。
In short:
pushMatrix()
is not a valid function inp5
. It doesn't exist. You want to find and replace all usages ofpushMatrix()
withpush()
andpopMatrix()
withpop()
.With those replacements your code runs without any errors and I see a square spinning around in the center of the canvas.
The error message is not particularly helpful, but looking at the source code clarifies things a lot.