mithun_daa

06-06-2004, 05:02 PM

hello everyone,

i have a huge terrain being loaded up onto my window. i have a 2d othro projection in my display rountine, then i have a perspective projection. how can i add another ortho projection to my display routine. is it possible?

im using my 2d othro projection to show up a backrground image and a scale showing the elevation and the associated color. what happens is when i zoom in all the way into my sceen, the scale hides behind the scene, cause its being rendered before the perspective projection shows the terrain and other info. i want to bring the scale in front.

i m using VB6

'load the projection matrix with identity

glMatrixMode mmProjection

glLoadIdentity

'set projection to 2D othrographic to render the frame buffer image

glOrtho -mintWidth / 2, mintWidth / 2, -mintHeight / 2, mintHeight / 2, -10, 10 '(mdblzmax - mdblzmin) / 2, -(mdblzmax - mdblzmin) / 2

glMatrixMode GL_MODELVIEW

glLoadIdentity

..................

.... render background and scale

'set the projection to perspective

glMatrixMode GL_PROJECTION

glPushMatrix

glLoadIdentity

gluPerspective msngFieldOfView, msngAspectRatio, mdblNearField, mdblFarField

glPushMatrix

glMatrixMode GL_MODELVIEW

glLoadIdentity

glPushMatrix

.............

.................

.. Render the terrain

...........

............

glPopMatrix 'pop projection matrix

glPopMatrix 'pop modelview matrix

glPopMatrix 'pop the scene

do i have to add another projection matrix and a modelview matrix or can i somehow use the earlier set ortho projection, cause the new one is exactly equal to the old one.

thank you

i have a huge terrain being loaded up onto my window. i have a 2d othro projection in my display rountine, then i have a perspective projection. how can i add another ortho projection to my display routine. is it possible?

im using my 2d othro projection to show up a backrground image and a scale showing the elevation and the associated color. what happens is when i zoom in all the way into my sceen, the scale hides behind the scene, cause its being rendered before the perspective projection shows the terrain and other info. i want to bring the scale in front.

i m using VB6

'load the projection matrix with identity

glMatrixMode mmProjection

glLoadIdentity

'set projection to 2D othrographic to render the frame buffer image

glOrtho -mintWidth / 2, mintWidth / 2, -mintHeight / 2, mintHeight / 2, -10, 10 '(mdblzmax - mdblzmin) / 2, -(mdblzmax - mdblzmin) / 2

glMatrixMode GL_MODELVIEW

glLoadIdentity

..................

.... render background and scale

'set the projection to perspective

glMatrixMode GL_PROJECTION

glPushMatrix

glLoadIdentity

gluPerspective msngFieldOfView, msngAspectRatio, mdblNearField, mdblFarField

glPushMatrix

glMatrixMode GL_MODELVIEW

glLoadIdentity

glPushMatrix

.............

.................

.. Render the terrain

...........

............

glPopMatrix 'pop projection matrix

glPopMatrix 'pop modelview matrix

glPopMatrix 'pop the scene

do i have to add another projection matrix and a modelview matrix or can i somehow use the earlier set ortho projection, cause the new one is exactly equal to the old one.

thank you