Sign in to follow this  
Damocles

Get viewing angle without camera position?

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this