Original Post
I use this method to project the texture.But the result wasn't right.where is wrong? glBindTexture(GL_TEXTURE_2D, texture[0]);//define the texture glTexGenfv( GL_S, GL_EYE_LINEAR, &Splane[0] );//{1.f, 0.f, 0.f, 0.f}; glTexGenfv( GL_T, GL_EYE_LINEAR, &Tplane[0] );// {0.f, 1.f, 0.f, 0.f}; glTexGenfv( GL_R, GL_EYE_LINEAR, &Rplane[0] );// {0.f, 0.f, 1.f, 0.f}; glTexGenfv( GL_Q, GL_EYE_LINEAR, &Qplane[0] );// {0.f, 0.f, 0.f, 1.f}; glMatrixMode(GL_MODELVIEW); glLoadIdentity(); glPushMatrix(); glMatrixMode(GL_TEXTURE); glTranslatef( 0.5, 0.5, 0.0 ); glScalef( 0.5, 0.5, 1.0 ); gluPerspective(45,1,0.1,100); gluLookAt(-40,2,30,0,0,0,0,1,0); glPopMatrix(); glMatrixMode(GL_MODELVIEW); gluLookAt(0,0,30,0,0,0,0,1,0); glBegin(GL_QUADS); glVertex3f(-10,-10,-10); glVertex3f(10,-10,-10); glVertex3f(10,10,-10); glVertex3f(-10,10,-10); glEnd();