PDA

View Full Version : glOrtho



snowboy
06-29-2001, 07:36 PM
Dear everyone.
As you know, opengl has a glOrtho function.
Even if I try to know this function
exactly, I am still confuing now.

What the heck glOrtho function?
When should I use this function?

Please explain me as specifically as possible.

Thanx.

Eber Kain
06-29-2001, 08:10 PM
Ortho is a projection mode that dosent deal with depth into the screen, an object could be at -2, or -200, and it will be the same size useing ortho.

Ortho is commonly used to display an overlay which is where you will do your on screen text and HUD info.

To use it, just swap to the projection matrix, call glLoadIdentity() then glOrtho(), go back to the modelview matrix, draw the overlay stuff, swap to the Projection matrix, call glPopMatrix(), go back to modelview, and continue drawing.

[This message has been edited by Eber Kain (edited 06-29-2001).]

snowboy
06-29-2001, 09:06 PM
Ortho is a projection mode that dosent deal with depth into the screen, an object could be at -2, or -200, and it will be the same size useing ortho.

Ortho is commonly used to display an overlay which is where you will do your on screen text and HUD info.

To use it, just swap to the projection matrix, call glLoadIdentity() then glOrtho(), go back to the modelview matrix, draw the overlay stuff, swap to the Projection matrix, call glPopMatrix(), go back to modelview, and continue drawing.

[This message has been edited by Eber Kain (edited 06-29-2001).][/QUOTE]

First of all, Thank you for your responding.
Actually, I am not accustomed to terms.
I am a beginner.

1. What is projection mode?
2. What is stand for HUD?
3. What is HUD?
4. What does mean that "an object could be at -2, or -200"?
5. What is modelview?

Coiuld you narrow down a little bit more about glOrthro function?

Thank you very much for your help.

ffish
06-30-2001, 04:47 AM
Originally posted by snowboy:
1. What is projection mode?
2. What is stand for HUD?
3. What is HUD?
4. What does mean that "an object could be at -2, or -200"?
5. What is modelview?


1. The projection matrix is where you set up your viewing volume. For example if you are standing in a field you can see in front of you for some distance and you can see to the left and right for some angle but you can't see behind you or above you. This is your "viewing volume" similar to what you set up with the projection matrix in OpenGL.

2. HUD = Head Up Display.

3. HUD is like the information displayed across the bottom of your screen when you play a game. Even when the 3D objects move in the screen in front of you, the HUD stays across the bottom of your screen. You commonly set up a HUD using glOrtho.

4. The object could be at -2 or -200 on the z-axis i.e any distance into the screen.

5. The modelview matrix is the matrix that you use for all your modelling code.

These are all basic terms. If you don't understand them, you need to buy a copy of the red book or look for an older version online. Red book = OpenGL Programming Guide.

Eber Kain
06-30-2001, 08:08 AM
The redbook can be found in the large .pdf download at nehe.gamedev.net, its the best thing your could download next to a compiler.

snowboy
06-30-2001, 09:37 AM
Thank you for your big helping.
I really appreciate you.

snowboy
06-30-2001, 11:33 AM
Thank you for your big helping.
I really appreciate you.