Jump to content
  • Advertisement
Sign in to follow this  
xenrik

Fixed mesh rotation

This topic is 4824 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey All, I have a mesh that I need to apply a fixed offset rotation to - this is independent of any variable rotation the mesh may have. I need this because sometimes when I load a mesh, its pointing in the wrong direction. I guess this could be done by having two seperate rotations, one for the fixed offset, and one for the 'real' rotation. If I don't have them as seperate rotations then when I apply a vector to move the mesh alongs its z axis (for example), it of course moves in the wrong direction. Is having two seperate rotations the way to go? The only reason I can think for not doing this is it means I'll have to apply two rotation calculations when rendering the mesh. Ideally what I think I would want is someway to rotate the vertices within the mesh or something similar - i.e. something that could be done once and then forgotten about. Cheers, xenrik

Share this post


Link to post
Share on other sites
Advertisement
Well - obviously you could rotate it in your modelling package and re-export. This is the cleanest method.

Another method is to use something like D3DXVec3TransformCoord() on all of the mesh points with the "fixed" rotation as the transform - this needs only to be done once at load time.

You're right in that you don't want to multiply an extra rotation matrix every frame for no real good reason - its just good programming practice.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!