Hi once again! I’ve asked this question before, but since I can’t seem to find the program where I had implemented it, I need to ask it again.
I’m creating a 3d scene etc. Now I’d like to create a few custom windows (using opengl quads) over this scene. It would really help if I’d change the projection from the 3d scene coordinates to the actual size of the window. What I tried so far is this:
void display()
{
// draw scene here
......
......
// draw extra window in here ///////////////////////////////////////////////
gl.glPushMatrix();
gl.glMatrixMode(GL.GL_PROJECTION);
gl.glLoadIdentity();
gl.glOrtho(0, 600, 0, 600, worldZNear, worldZFar);
gl.glMatrixMode(GL.GL_PROJECTION);
gl.glLoadIdentity();
if (leftMouseBtnDown) {
// next method transforms from window to world coordinates
makeTransform(gl, glu, lastWindowClick, lastUserClick);
if (win1.titleBarClicked(lastUserClick[0], lastUserClick[1])) {
//System.out.println("HElllooo");
}
}
gl.glEnable(GL.GL_BLEND);
win1.drawWindow(gl);
gl.glDisable(GL.GL_BLEND);
gl.glPopMatrix();
// finished drawing extra windows //////////////////////////////////////////
glFlush();
}
But this destructs my projection and I can’t see anything (black screen) This is actually the same problem as with printing text where one would need an orthographic projection to have proper results.
Another thing that concerns me here, is that the windows need to be transparent, so if I’m not mistaken I need to draw them in the end. Any ideas?