Charles

05-28-2004, 04:54 PM

Having tried some code from Computer Graphics 3rd edit in C (foley) I have been working on, I started messing with my ModelView. My rotation and translation work, however I obtain two copies of the same display, list. My question is that (to the best of my knowledge) a linear transformation has a unique image in the range. i.e for any x,y,z there are unique x',y',z' under an affine transformation. why have i ended up with two images?

Sample code I was testing

glPushMatrix();

float modelview[16];

glGetFloatv(GL_MODELVIEW_MATRIX , modelview);

//Change The Matrix

for(int i=0; i<3; i++ )

for(int j=0; j<3; j++ )

modelview[i*4+j] = PlaneMatrix[i+4*j];

//Change The Translations

modelview[12]=xtrans+ PlaneMatrix[12];

modelview[13]=ypos + PlaneMatrix[13];

modelview[14]=-12.5f-ztrans+PlaneMatrix[14];

//Reload Updated Matrix

glLoadMatrixf(modelview);

BuildAircraft();

glPopMatrix();I end up with two aircraft, which seem to be reflections of each other. One of them has the desired property (following a Direction of flight)

the other is unwanted.

What is going on behind the scenes to produce a second image?

Sample code I was testing

glPushMatrix();

float modelview[16];

glGetFloatv(GL_MODELVIEW_MATRIX , modelview);

//Change The Matrix

for(int i=0; i<3; i++ )

for(int j=0; j<3; j++ )

modelview[i*4+j] = PlaneMatrix[i+4*j];

//Change The Translations

modelview[12]=xtrans+ PlaneMatrix[12];

modelview[13]=ypos + PlaneMatrix[13];

modelview[14]=-12.5f-ztrans+PlaneMatrix[14];

//Reload Updated Matrix

glLoadMatrixf(modelview);

BuildAircraft();

glPopMatrix();I end up with two aircraft, which seem to be reflections of each other. One of them has the desired property (following a Direction of flight)

the other is unwanted.

What is going on behind the scenes to produce a second image?