From: Andy Bailey (andrew++at++scs.leeds.ac.uk)
Date: 02/28/2000 06:06:41
Hi,
I am using some GL to draw a polygon (representing some sky) in the draw
callback of my Performer App. I cannot use the pfEarthSky as we use
off-axis viewing frusta.
Here is the code...
pfDraw();
pfPushState();
pfBasicState();
glTranslatef(ViewState->modelCoord.xyz[PF_X],
ViewState->modelCoord.xyz[PF_Y], ViewState->modelCoord.xyz[PF_Z]);
glRotatef(ViewState->modelCoord.hpr[PF_H], 0.0f, 0.0f, 1.0f);
glColor4f( 0.0, 0.0, 1.0, 1.0 );
glBegin(GL_POLYGON);
glVertex3f( -2.588, 0.0, 100.0 );
glVertex3f( 2.588, 0.0, 100.0 );
glVertex3f( 800.0, 2000.0, -200.0 );
glVertex3f( -800.0, 2000.0, -200.0 );
glEnd();
pfPopState();
This is giving me the desired sky effect in front of the object and it
is rotating with the heading of the object OK. But when I pitch or roll
the object the polygon is also pitching/rolling which is not what I
want. I suspect this is a problem with the view matrix having the pitch
and roll in already, and that I need to start with the identity matrix.
Am I right or is there something else?
Also does this seem like a good idea for getting around the off-axis
viewing frusta problem with pfEarthSky?
thanks,
Andrew
This archive was generated by hypermail 2b29 : Mon Feb 28 2000 - 06:40:12 PST