Jump to content
  • Advertisement

Archived

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

dachande

Rotating to Look At

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

Hey, There seems to be many posts relating to rotating recently, I apologise adding to them. Here is my problem, I though I''d ask the community to get some suggestions, after getting precious little information from the web. I have an object or model at X, Y, Z position. I want to be able to use glRotate to rotate the object so that it is facing a position at x, y, z. I can''t seem to find a method to find out how much I will need to rotate to do this, any help would be greatly appreciated, Thanks, Dachande

Share this post


Link to post
Share on other sites
Advertisement
Well, it is just some trigonometry, so you''re unlikely to find any information on the web. Simple solution: assume w.l.o.g. that you are at the original, rotate first in the xy plane, then rotate to get the correct elevation. Draw a picture and it''ll be clear.

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!