rotating vertices

Started by
20 comments, last by L. Spiro 10 years, 6 months ago
That's nonsense. You can rotate around any point you please with matrices (and obviously by glRotatef). You just have to apply T^-1 * R * T instead of just R, where T is a translation matrix which moves the desired center point to the origin.
Advertisement

He needs to. He wants to rotate AROUND a point. Not at the centerpoint which glRotatef() would do. tongue.png

According to this:

but it still rotates around the center of the screen, but does not rotate around the center of the shape.

He wants to 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.




What, in wrong order? I don't understand, when would he even want to use the order you suggested? First translate, then rotate.

When you want to rotate around the center of the object, as he said he wants to do.
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.


L. Spiro

I restore Nintendo 64 video-game OST’s into HD! https://www.youtube.com/channel/UCCtX_wedtZ5BoyQBXEhnVZw/playlists?view=1&sort=lad&flow=grid

This topic is closed to new replies.

Advertisement