Jump to content
  • Advertisement
Sign in to follow this  
Lipponen

Rotation, again!

This topic is 4138 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 have, as everyone else seems to have, a rotation problem! Ive been reading on the forum and on resources on the internet(s) about rotation - but I just cant get my head around this "error" Im getting. Green arrow is my orientation of my Enitity. Blue dot is the goal-orientation that I want my Entity to be facing (green arrow). Then thing is that my Entity does not change its facing. Here is some code to show you how I make my error. www.catamarana.com/cpp/?id=29

Share this post


Link to post
Share on other sites
Advertisement
I didn't look that closely, but this looks wrong:
world = rot * trans;
rot appears to be a relative rotation (i.e. a fairly small local rotation), but you're using it to build the world/model matrix for the object. I would think this would result in a near-constant orientation for your object (which seems to be what you're observing).

To get the correct orientation, you need to build a rotation matrix from the current forward vector (this is kind of a roundabout way of doing it, but I'd try to get this version working before considering any further revisions).

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!