# Thread: World, camera, object coordinates in the glOrtho function

1. ## World, camera, object coordinates in the glOrtho function

I have a great confusion, when I have to use the glOrtho function, I do not know which system of coordinates it uses for its parameters, namely: left, right, bottom, up, close, do they are compared to what coordinate system? Would it be possible to have a figure that shows me clearly and unambiguously?

2. Eye space. If you get a decent OpenGL book, it'll describe this pretty clearly:

* OpenGL Projection Matrix (Ahn)

3. Originally Posted by Dark Photon
Eye space. If you get a decent OpenGL book, it'll describe this pretty clearly:

* OpenGL Projection Matrix (Ahn)
Ok, but near and far in the glOrtho: these values are negative if the plane is to be behind the viewer. Is the viewer the camera or the object ?

4. Originally Posted by giorgik
Ok, but near and far in the glOrtho: these values are negative if the plane is to be behind the viewer.
Correct. So near/far are actually the negation of eye-space Z axis values.

Is the viewer the camera or the object ?
The camera.

To your original question, the glOrtho parameter values are specified in eye-space. In eye-space, the camera (the viewer) is at the origin looking down the -Z axis with +X right and +Y up.

So as for the glOrtho parameters...:

• left and right are eye-space X axis values
• bottom and top are eye-space Y axis values
• near and far are eye-space Z axis values, but negated!

So for instance, glOrtho with a near argument of 1.0 equates to the Z = -1.0 plane in eye-space, which is in front of the eye (the origin).

5. Originally Posted by Dark Photon
Correct. So near/far are actually the negation of eye-space Z axis values.

The camera.

To your original question, the glOrtho parameter values are specified in eye-space. In eye-space, the camera (the viewer) is at the origin looking down the -Z axis with +X right and +Y up.

So as for the glOrtho parameters...:

• left and right are eye-space X axis values
• bottom and top are eye-space Y axis values
• near and far are eye-space Z axis values, but negated!

So for instance, glOrtho with a near argument of 1.0 equates to the Z = -1.0 plane in eye-space, which is in front of the eye (the origin).
Oh, it's finally clear now. So close values and positive results in GlOrtho are actually negative on z axis.
Thank you, Dark Photon

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•