Jump to content
  • Advertisement
Sign in to follow this  
RavNaz

md3 model renderer && tag rotations going the wrong way

This topic is 3687 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

hi people, I'm writing an md3 render and Ive got the data loaded in and rendering and animating, except that the rotations i'm applying from the tags seem to be rotating the wrong way. so for example, in the death anim, the torso doesnt rotate back properly, it looks as though its rotating to the left. It's almost as if, the rotations are around the wrong axis. I'm using my own dx engine, and the matrices are in col.xyzw order (im using mtxlib). I presume that I need to convert the matrices or something, but I dont know exactly how.... any ideas?

Share this post


Link to post
Share on other sites
Advertisement
In which modelling app did you use to create the models and which graphics library does it use?
There are two possible causes that I can think of:
Firstly, the axis definition of your modelling app vs axis definition of your dx app. Some modelling apps define the z axis as the up-axis, whereas graphics libs define the y axis as up axis.
Secondly, the modelling app may use a differently handed coordinate system than dx (right-handed vs left-handed coordinate systems). This will effectively inverse any rotations around your up-axis. This doesn't sound like your problem though, but keep it in mind that if you see weird rotations it may be this.

You may want to try to swap the y and z components (or swap any other pair, I don't know from the top of my head) of your mesh when loading the model. But if you do that your mesh will not stand upright in your application so you have to rotate 90 degree around your x-axis to compensate for that.
Alternatively, you can try to compensate for the swapped axes in the rotations of the animation, but I don't know how hard that is since I'm not that big on the maths front.

Share this post


Link to post
Share on other sites
hi, thanks for reply. I already have to swap the z & y for the position offset, and am also having to rotate the entire model by 90degrees to get it standing upright. Single frame of the guy standing is fine. Like I said, when playing the aninmation and using the tag rotations, he seems to rotate the wrong way.

With the above in mind, Im not sure where to go now.... doh!!

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!