Re: [Flightgear-devel] Drawing with OpenGL in Flightgear
On Thu, Mar 20, 2003 at 04:32:57PM -0800, Andy Ross wrote: > > If you want to draw into screen space, you'll need to push the > identity matrix onto the *projection* stack as well. Otherwise the > coordinates you are using will end up drawing a 1m x 1m square > parallel to the equatorial plane at the local tile origin. Probably > not what you had in mind. :) not really ;) thanks for your help - pushing the identity matrix onto the projection stack works great. regards, Richard ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
Re: [Flightgear-devel] Drawing with OpenGL in Flightgear
Richard Airlie wrote: > I am trying to draw an OpenGL quad at the very end of fgRenderFrame in > main.cxx, just before the glutSwapBuffers by doing: >glMatrixMode(GL_MODELVIEW); >glPushMatrix(); >glLoadIdentity(); > [...] > This has worked on a few occasions, but not all the time. If you want to draw into screen space, you'll need to push the identity matrix onto the *projection* stack as well. Otherwise the coordinates you are using will end up drawing a 1m x 1m square parallel to the equatorial plane at the local tile origin. Probably not what you had in mind. :) If what you really want to do is draw into 3D space, you should look at the panelnode.cxx class. This is the wrapper around the 2D panel code that maps it's internal "screen space" notion into the 3D world. You could probably clone or hook this to do what you want. Alternatively, it may be that what you want to do be handled already (no OpenGL required) by the existing panel framework. Andy -- Andrew J. RossBeyond the OrdinaryPlausibility Productions Sole Proprietor Beneath the Infinite Hillsboro, OR Experience... the Plausible? ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
[Flightgear-devel] Drawing with OpenGL in Flightgear
Hi all, I am trying to draw an OpenGL quad at the very end of fgRenderFrame in main.cxx, just before the glutSwapBuffers by doing: glMatrixMode(GL_MODELVIEW); glPushMatrix(); glLoadIdentity(); glDisable( GL_FOG ); glDisable( GL_DEPTH_TEST ); glDisable( GL_LIGHTING ); glDisable( GL_TEXTURE_2D ); glColor3f( 0.9, 0.4, 0.2 ); glBegin(GL_QUADS); glTexCoord2f(0,0); glVertex3f(0,0, 0); glTexCoord2f(1,0); glVertex3f(1,0, 0); glTexCoord2f(1,1); glVertex3f(1,1, 0); glTexCoord2f(0,1); glVertex3f(0,1, 0); glEnd(); glPopMatrix(); This has worked on a few occasions, but not all the time. What I really want is to be able to draw an overlay in 3D space at the end of the draw loop. I realise that Flightgear is using plib ssgnode rendering stuff, but I don't know plib and really only want to hack this in for now. How can I render some OpenGL prims at the end of the draw loop? many thanks, Richard. ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel