🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Rotation axis

Started by
2 comments, last by Ozz 24 years, 1 month ago
I have a small app which loads an obj model, When I rotate the model it moves about point far away from it, I can`t seem to figure out how to get the model to spin around a specific point i.e in the center of the model.
Advertisement
If you are doing translations to move your view farther away from the object, make sure that you do the translations and then the rotations (not vice versa). You also might want to see how the vertices for the object are defined, if they are all defined far away from an origin of (0,0,0) in the same direction (like all positive z positions, or all negative z positions) then that could be the problem and you might want to fix the object. Hope that helps.

Morgan
1) the object was centered in 0,0,0 (ie. a box was vertices -20,-20,-20 and 20,20,20). This center is the point of rotation.
2) First rotate, then translate. If you use matrix multiply, it is very important!!.



-eng3d-
-----------------------------------------------"Cuando se es peon, la unica salida es la revolución"
I figured it out, thanks.

This topic is closed to new replies.

Advertisement