Simple ortho mode question

hi gregg,

i was wondering on how you achieved to have all the GUI sit ontop of everything, as in with an infinite z scale.

because using:

GLU.gluOrtho2D(0, Window.getWidth(), 0, Window.getHeight());

alone renders it to the back, as in infinit -z scale!

also using:

GL.glOrtho(0, Window.getWidth(), 0, Window.getHeight(), 0, 1);

has the same effect with the -z scale.

Much appreciated

I add the GUI stuff to the scene graph last so it renders last.

I have yet to found anything that comes right out and says it, at least in a way I understand it, but it seems like gluOrtho2D disables depth buffering. It’s probably doing something else that just makes seem that way. My understanding of OpenGL is somewhat shallow. :slight_smile:


you and me both! :slight_smile:

how did you make it render last? because i am creating a tint thing, and I want it to be above everything else, so rendering last basically. Mojomonkey is creating something that will sort stuff out depending on alpha values, but that will not be till later.

If you look in the module, TestWidgetButtonLightSwitch, at the end of the initGame method you will see where I attach the frame to a root node.


If you look a couple of lines above it I attach a node that contains the geometry.


In this scenario the GUI part of the scene is in a node by itself, at the same level as the geometry node. Maybe that’s how it needs to be constructed for it to render correctly, keeping the ortho stuff seperated into it’s own node. I haven’t experimented.

I do know if I attach the frame node first the geometry will render on top of the GUI.


much appreciated gregg