rotating obejcet

Started by
2 comments, last by Floru 24 years, 1 month ago
Hi! I have a problem with rotating object in 3D space. When I try to rotate a object it rotates but at the same time it moves around origo of the hole world. So when the object coordinates are 0,0,0 it just rotates without moving anywhere... I''m trying to make base class for objects which I then could use in subclasses. This base class would handle basic translations and rotations etc. Is there a good example of this kind of class? I''m using DirectX. Floru
Advertisement
I would recommend first rotate the 3D Model and then translate (offset model in world coordinates). And if the model needs to rotate in the world coordinates do one more rotation.
Yeah, Anonymous is right, order matters. You are translating then rotating, you need to rotate then translate.
Me again!

You will have to rotate first, because rotation formulas operate from an origin relative to the model.(usually the center of the model)

This topic is closed to new replies.

Advertisement