Coordinate system question

How do I retrieve, or set the visible coordinate system of a perspective volume?

I know how to map the x,y on an ortho volume to the window’s x,y, but is there a way to do this for perspective volumes?

Hmm, is it just me or do I seem vague here?

What I’m trying to do is find out what the ratio is between 1.0 units in the x or y direction on a given plane x,y along the z axis in relation to the window coordinates.

ie: the right-most edge of the window is, say, 400 pixels. I want to know what that is in volume units 200 units back into the viewing volume. I know it will be much bigger than 400.

Siwko

As long as you have access to the viewing matrix (GL_MODELVIEW) and projection matrix (GL_PROJECTION), you can use the “gluProject” function (part of the GLU library). You pass in your object coordinates (x,y,z), model view matrix, projection matrix, and viewport extents. The function returns the window (x,y,z).

Originally posted by Siwko:
[b]How do I retrieve, or set the visible coordinate system of a perspective volume?

I know how to map the x,y on an ortho volume to the window’s x,y, but is there a way to do this for perspective volumes?

Hmm, is it just me or do I seem vague here?

What I’m trying to do is find out what the ratio is between 1.0 units in the x or y direction on a given plane x,y along the z axis in relation to the window coordinates.

ie: the right-most edge of the window is, say, 400 pixels. I want to know what that is in volume units 200 units back into the viewing volume. I know it will be much bigger than 400.