Jump to content
  • Advertisement
Sign in to follow this  
bearsomg

Math Help - Automatically calculate camera rotation

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

Here's my issue:

My program has just a back wall and floor. The user is able to move the virtual camera around and zoom in and out. I need the floor to appear completely level, where the camera can only see the front of it, no matter what the Y translation coordinate or FOV is. What would the correct way to calculate the camera's Y rotation from the Y translation coord and FOV be?


Currently through experimentation, I was able to form an equation where it calculates rotation based on the Y translation coord, but obviously it does not work when the user zooms in or out (change in FOV).



I am using gluPerspective, and I would not like to change this.

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

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