Jump to content
  • Advertisement

Archived

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

zerwit

Direct3d Rotation Troubles

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

I am trying to rotate a cube using the mouse in Direct3d. But when it is rotated to the left, and then rotated up, it does the up rotaton first and then the sideways rotation. If I switch the orders that I multiply the rotation matrices, then it just screws up with other rotation combinations. I know why it is doing this, but I need to find a method on how to achieve the desired effect. If it''s rotated to the left and then up, it should do it in that order. But if it''s rotated up and then left, it should do it in that order. One solution would be to keep track of it''s rotated coordinates each frame, but I would rather find a better solution. Does it have something to do with quaternions? Thanks for any help. *** Triality ***

Share this post


Link to post
Share on other sites
Advertisement
I''ve had the same problem programming a flight sim. The easiest thing tod do is to use a matrix for the object''s orientation. Then you multiply it with a rotation matrix in the right order whenever the mouse moves.
(This is easy to implement in D3DIM, but D3DRM might be a pain...)

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!