p5js上的翻转图像y轴
我需要在P5J中的Y轴上翻转图像,
我知道对于X轴上的翻转,以下代码有效
push();
scale(-1, 1)
image(pg,-width/2,0, width/2, height);
pop();
,但我找不到在Y轴上进行操作的方法。
I need to flip a image over the Y axis in P5js
I'm aware that for the flip over the X axis the following code works
push();
scale(-1, 1)
image(pg,-width/2,0, width/2, height);
pop();
But I can't found the way to do it over the Y axis.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将Y轴缩放为-1:
并用
-height
的y坐标绘制图像:Scale the y axis by -1:
And draw the image with a y-coordinate of
-height
: