PDA

View Full Version : Render frustum and local coordinate system



Mikael Ara
10-29-2012, 07:56 AM
Hi, I am new in programming with openGL, and how a question:

I am doing camera calibration now, and have rendered 12 cameras on my screen. Let's talk only about one. I need to draw it's frustum, and local coordinate system, but don't know how.

I will be very thankful if you can help me.

Best regards,
Mike.

Dark Photon
10-29-2012, 10:48 AM
Look at the docs for glFrustum() and/or glOrtho. That tells you the corners of that frustum (call it frustum B) in that frustum's eye space. You can draw the sided or edges using that. See these good reference pages by Song Ho Ahn:

* OpenGL Transformation (http://www.songho.ca/opengl/gl_transform.html)
* OpenGL Projection Matrix (http://www.songho.ca/opengl/gl_projectionmatrix.html)

Before you draw it though, you need to have that space active. If the frustum your using for your currently rendered view is frustum A, put frustum A's VIEWING transform on the MODELVIEW stack. Then add on the "inverse" VIEWING transform for frustum B. Then draw your frustum B sides/edges in frustum B's EYE-SPACE.

Mikael Ara
10-29-2012, 12:05 PM
Look at the docs for glFrustum() and/or glOrtho. That tells you the corners of that frustum (call it frustum B) in that frustum's eye space. You can draw the sided or edges using that. See these good reference pages by Song Ho Ahn:

* OpenGL Transformation (http://www.songho.ca/opengl/gl_transform.html)
* OpenGL Projection Matrix (http://www.songho.ca/opengl/gl_projectionmatrix.html)

Before you draw it though, you need to have that space active. If the frustum your using for your currently rendered view is frustum A, put frustum A's VIEWING transform on the MODELVIEW stack. Then add on the "inverse" VIEWING transform for frustum B. Then draw your frustum B sides/edges in frustum B's EYE-SPACE.

Thank you for quick answer, I will look through it, and if you don't mind, I will ask some questions personally, if I have them.

Mikael Ara
10-29-2012, 12:21 PM
Thank you for your quick reply. I will look through that links, and if you don't mind I will ask questions personally if I have them.