I need to know about trig. I read something about it on the forums, forgot and i need it now. How do I get something to rotate around something not it's center of rotation. (I read something about this on a post)
Offline
Here, I made an engine: http://scratch.mit.edu/projects/Kileyme … est/872439
Offline
To explain, basically, using trig, the sprite first calculates its distance to the object (without the distance block, instead it uses the distance formula), then uses the atan (tangent^-1) function to find it's direction relevant to the point it is supposed to revolve around. This does not change its true direction, but calculates a new, figurative one.
Next, you can align your sprite to the object by making your x value the sin of the new direction times the distance to the object. Same for y value but you would use cosine. This will align it to the point it's already on, you can alter the new direction by a few degrees but keep the distance the same, meaning it will rotate around the object but stay the same distance from it.
Phew, I just reread that and it sounded mighty complex. Did you understand all of that?
Last edited by Kileymeister (2010-12-19 12:32:48)
Offline