Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

b612

md2/md3 rotation "backwards"

This topic is 5222 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, I''m having a problem with rotation and Quake 2/3 models in my engine. Adding to the model''s Y rotation causes the model to rotate to it''s right, and this is causing many problems with attaching a weapon to the camera for a first person shooter effect. Simply "flipping" the rotation value and applying it to the weapon model only works about half the time. I''m assuming this has to do with OpenGL''s right handed coordinate system? Any ideas on a fix?

Share this post


Link to post
Share on other sites
Advertisement
I am not 100% sure I am following you. Even though its not a directx question directly, I might be able to help, if I can understand what exactly your problem is.

I don''t know what you mean by adding to a models Y rotation.
I guess aside from the problem, I don''t understand 100% what your end result(aside from fixing this problem is)

Sorry its late :-)

Share this post


Link to post
Share on other sites
Sounds like you're trying to use a vector to rotate the gun. Why not just apply the hand matrix to it?

The hand offset matrix places the hand at it's own rotation orientation and position, so you would need to place the gun there before you try to rotate it. Then apply the hand's inverse offset matrix after the rotation to put it back to be rendered.

EDIT: Err, I'm new at this animation stuff, so I'm not sure what md2 or md3 are. I'm guessing you're not using bone matrices? Still, it sounds like your model has it's own orientation. You need to find that orientation and do the above with it instead of a hand.

[edited by - Jiia on June 6, 2004 2:33:35 AM]

Share this post


Link to post
Share on other sites
Say this is executed every frame:
static float y = 0.0f;
y += .05f;
model->setRotation(0,y,0);

This is causing the model to rotate to it''s right, when usually in DirectX model''s rotate to their left when their Y rotation value is added to. This is causing the gun model attached to my camera (the gun model is moving correctly with the camera, only the rotation is wrong) to rotate in the opposite direction the camera is. IE i turn right, the model rotates left - same for up and down.

Share this post


Link to post
Share on other sites
Maybe I am just on some good pain killers from surgery, but if you add to the Y it appears to move to its Right, not to the left as you suggest.

Just to make sure it wasn''t my code, I opened up the VB .Net Tutorial 3, which rotates with a positive number, around the Y axis a simple triangle, and it moves to the right everytime. I then plugged in a (-) sign and it went to the left.

Just curious, have your tried the RotationY function to see if you get the same result as RotateAxis?

Share this post


Link to post
Share on other sites
Ok, thanks for the reply, for the most part I have it working, except for good rotation on the model. Any help with this?

Share this post


Link to post
Share on other sites

  • 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!