The code is somewhat long, but here it is. The part that draws all my pages is in the last for loop.
void book UINT cover,UINT sides,int pages, float turned[], UINT pimage[]
{
#define PI 3.1415926535
float front = turned[0];
glEnable GL_TEXTURE_2D ;
glBindTexture GL_TEXTURE_2D, cover ;
glBegin GL_QUADS ;
glTexCoord2f 0,0 ;
glVertex3f -1,0.25,-1 ;
glTexCoord2f 0,1 ;
glVertex3f -1,0.25,1 ;
glTexCoord2f 1,1 ;
glVertex3f sin front *2-1,cos front *2+0.25,1 ;
glTexCoord2f 1,0 ;
glVertex3f sin front *2-1,cos front *2+0.25,-1 ;
glEnd ;
glBindTexture GL_TEXTURE_2D, sides ;
glBegin GL_QUADS ;
glTexCoord2f 0,1 ;
glVertex3f -1,0.25,-1 ;
glTexCoord2f 1,1 ;
glVertex3f -1,0.25,1 ;
glTexCoord2f 1,0 );
glVertex3f -1,-0.25,1 ;
glTexCoord2f 0,0 );
glVertex3f -1,-0.25,-1 ;
glTexCoord2f 0,0 ;
glVertex3f -1,-0.25,-1 ;
glTexCoord2f 0,1 ;
glVertex3f -1,-0.25,1 ;
glTexCoord2f 1,1 ;
glVertex3f 1,-0.25,1 ;
glTexCoord2f 1,0 ;
glVertex3f 1,-0.25,-1 ;
glEnd ;
glDisable GL_TEXTURE_2D ;
glEnable GL_TEXTURE_2D ;
glBegin GL_QUADS ;
for int x = 2; x < pages+1; x++
{
glBindTexture GL_TEXTURE_2D, pimage[0] ;
glTexCoord2f 0.0,0.0 ;
glVertex3f -1+ sin turned[pages+1-x] *0.01, float x/ pages*2 -0.255 + cos turned[pages+1-x] *0.1, -1 ;
glTexCoord2f 0.0,1.0 ;
glVertex3f -1+ sinturned[pages+1-x] *0.01, float x/ pages*2 -0.255 + cos turned[pages+1-x] *0.1, 1 ;
glTexCoord2f 1.0,1.0 ;
glVertex3f -1+sin turned[pages+1-x] *2, float x/ pages*2-0.255 +cos turned[pages+1-x] *2, 1 ;
glTexCoord2f 1,0 ;
glVertex3f -1+sin turned[pages+1-x] *2, float x/ pages*2 -0.255 +cos turned[pages+1-x] *2, -1 ;
}
glEnd ;
glDisable GL_TEXTURE_2D ;
}
any and all replies are greatly appreciated. thanks