PDA

View Full Version : Different projection?!?



Peter
07-22-2000, 05:28 PM
Hi there!

How do i render an object at a constant size regardless of the z value? For example: An object at (10,10,10) should appear to have the same size as an object at (10,10,-10) on screen. And, when projecting these on the screen, they should be centered at their (x,y,z) values. Thus, depending on its z value in a perspective projection.

So the output on screen should be as follows: Two objects that have the same size but one of the objects will appear closer to the origin on screen due to its center has a different z value.

Does this make sense?

Any ideas?

//Peter... Thanx...

ngill
07-22-2000, 08:17 PM
Originally posted by Peter:

So the output on screen should be as follows: Two objects that have the same size but one of the objects will appear closer to the origin on screen due to its center has a different z value.


sounds like you would like an Orthogonal (spelling?) projection. Although your quote distracts me from this because normally the only way I thought you'd make an object seem closer is by adding perspective (ie objects closer appear larger). But, if you're looking for an Ortho Projection check out the function:

glOrtho2D()

remember to change the matrix mode to GL_PROJECTION by using glMatrixMode(GL_PROJECTION);

-Navreet