Get viewing angle without camera position?

Started by
3 comments, last by Damocles 16 years, 10 months ago
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.
------------------------------------------[New Delta Games] | [Sliders]
Advertisement
you can get the camera position and orientation from OpenGL. glGetFloatv(GL_PROJECTION_MATRIX, mat) I believe.

something like that.

Everything is better with Metal.

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.
whoops, yeah, I meant the modelview matrix.

Everything is better with Metal.

Thanks for your help guys.
------------------------------------------[New Delta Games] | [Sliders]

This topic is closed to new replies.

Advertisement