Quick question, I havent figured it out yet, thought maybe someone else had. When you call rotate, I have come across couple methods for speed, but havent figured out rotation direction. All objects/images seem to go counter clockwise… Do I need to start calling out vec/X/Y etc etc ?
use negative degrees.
there is a trick: translate the rotated thing to 0, then rotate it and translate it back to the position before.
if you mean what i mean…
First, though the documentation states that rotate takes radians, it doesn’t. I think you’ve already worked that out. Secondly, the location of “north” for rotation purposes might be where you expect.
Try something like this
pushMatrix()
translate(self.x, self.y)
rotate(self.deg - 90)
' your drawing here
popMatrix()
Dont forget to push & pop (or clearMatrix()) to avoid compounding rotations.
@Mark from my brief look at the documentation rotate() says it uses degrees (while vec2:rotate mentions radians).
You’re right, I got the two mixed up. Apologies.
@Mark, Well “North” is relative I suppose. If I insert the sprite, I have to adjust it manually so its not facing the wrong way from the start. I think your comment about using push/pop/clearmatrix is my problem. It was receiving some “hand me downs” a half dozen lines up or so from another image.
Think an old school afterdark screensaver. All kinds of small stuff going off doing whatever… I have to be careful to clean up properly.
Thanks y’all !