Jump to content
  • Advertisement
Sign in to follow this  
Damocles

Get viewing angle without camera position?

This topic is 4154 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'm trying to get the viewing angle normal of the camera, even though I don't have a camera location/viewing target location. Instead I'm using a fixed viewing angle, where the only operation is that I rotate the model matrix around the x angle to give a "tilt" to the view. Now I find I need the viewing angle for some angle of incidence calculations, but I'm having a little trouble finding the angle. I could use some tips on converting a rotated model matrix into a camera angle.

Share this post


Link to post
Share on other sites
Advertisement
you can get the camera position and orientation from OpenGL. glGetFloatv(GL_PROJECTION_MATRIX, mat) I believe.

something like that.

Share this post


Link to post
Share on other sites
What oliii said, but it's GL_MODELVIEW_MATRIX. Then you can get the transposed z-axis (which is the camera's forward vector) and work it out from that.

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!