I am trying to set an image (.rgb) as a background of a window, and have a dynamic texture mapped 3D object (torus) rotate in front of it.
I have a QUAD set up the same size as my widow, but it is rotating with the torus, infact, it is `slicing’ the torus right through the middle.
I have a feeling that I am rotating everything in the window, or the viewpoint, instead of just the torus.
Does anyone know how to fix this?
I have a snip-it of code below.
Any help would be greatly appreciated.
Andrew.
void display(void)
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glBegin(GL_QUADS) ;
glTexCoord2f(0.0,0.0) ; glVertex2f(-15.0,-15.0) ;
glTexCoord2f(0.0,1.0) ; glVertex2f(-15.0, 15.0) ;
glTexCoord2f(1.0,1.0) ; glVertex2f( 15.0, 15.0) ;
glTexCoord2f(1.0,0.0) ; glVertex2f( 15.0,-15.0) ;
glEnd() ;
glBindTexture(GL_TEXTURE_2D, textures[0]);
glEnable(GL_TEXTURE_2D);
glEnable(GL_TEXTURE_GEN_S);
glEnable(GL_TEXTURE_GEN_T);
glEnable(GL_CULL_FACE);
glRotatef(5.0, 1.0, 1.0, 1.0);
glutSolidTorus(2.0, 5.0, 50, 50);
glDisable(GL_TEXTURE_GEN_S);
glDisable(GL_TEXTURE_GEN_T);
glDisable(GL_CULL_FACE);
glutSwapBuffers();
}