Crossbones+ - Reputation: 4930
Posted 30 September 2013 - 08:05 AM
Crossbones+ - Reputation: 16459
Posted 30 September 2013 - 10:16 AM
According to this:
He needs to. He wants to rotate AROUND a point. Not at the centerpoint which glRotatef() would do.
He wants to rotate around the center of the shape.
but it still rotates around the center of the screen, but does not rotate around the center of the shape.
But either way raw trigonometry is unnecessary, as it was already pointed out that applying first the inverse translate of the center point prior to rotating, lastly followed by the object’s translation, can all be done with matrix math.
When you want to rotate around the center of the object, as he said he wants to do.
What, in wrong order? I don't understand, when would he even want to use the order you suggested? First translate, then rotate.
Otherwise you translate by the opposite of the center of rotation, rotate, and then apply object translation. In other words, when working with only the object’s translate and rotate, rotate always comes last.
SCALE * ROTATE * TRANSLATE.
My Art: http://l-spiro.deviantart.com/gallery/4844241/Realism My Music: https://soundcloud.com/l-spiro
L. Spiro Engine: http://lspiroengine.com
L. Spiro Engine Forums: http://lspiroengine.com/forums