PDA

View Full Version : Fooling glOrtho?



Ronan
11-29-2001, 01:50 AM
I have panel showing some instrments, which give attitude info for an aircraft. the panel uses glOrtho, and the instruments themselves are basically a collection of polys which rotate according to the pitch, roll and yaw of the aircraft.

this works fine apart from the fact that it looks a bit naff, especially considering i have a 3d model of the aircraft available. what i would really like to do is use the aircraft model instead of the polys. unfortunately, the model was created using the real dimensions of the aircraft and the sizes mean that the model is tiny on the screen.

now, i understand that ortho doesn't do depth, but is there any way to zoom in to the model? if not would it be possible to use frustrum for the model and then overlay the rest of the display using ortho, or am i just dreaming? is there anything else that might work, or will i just have to redo the whole thing around my aircraft model,which i really don't want to have to do.

cheers
ronan

JML
11-29-2001, 04:08 AM
Ronan,

It is certainly possible to use multiple projections (perspective, ortho and mixes) to produce the final results of a render.

Just keep in mind that each projection maps the depth component to [0-1], where world-near maps to zero and world-far to 1.
This causes an object at distance 50 drawn with (near,far) = (1, 100) to obscure an object drawn at distance 9 with (near, far) = (1, 10).

A way to make sure that the cockpit elements (done with ortho) are not 'mixed' with the view through the window is to render them last and turn off depth testing while rendering them.

HTH

Jean-Marc