md2/md3 rotation "backwards"
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?
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 :-)
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 :-)
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]
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]
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.
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.
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?
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?
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement