I’d like to change the coordinate system in a 2d processing sketch, putting (0,0) in the bottom-left rather than the top-left. The following code will move (0,0) to the bottom-left:
transform(0, height);
rotate(radians(-90));
However, it also makes the X-axis the vertical axis. Is there a simple way to move (0,0) to the bottom-left and keep the X-axis horizontal?
One option I’ve considered is using P3D with a combination of rotate and rotateY, but would prefer a solution for the 2d case.
Thanks for any help!
You could simply translate without rotating:
And handle your coordinates as flipped:
boolean useVFlip = true;
If it makes it easier to get flipped coordinates, you could flip the whole coordinate system using the scale() method:
boolean useVFlip = true;
You could do the same with a PMatrix2D, but not sure how familiar your are with them:
boolean useCustomCS = true;
PMatrix2D customCS;