OpenGL


9. 3D - 9


if (twinkle)// Twinkling

{

//

glColor4ub(star[(num-loop)-1].r,star[(num-loop)-1].g,

star[(num-loop)-1].b,255);

glBegin(GL_QUADS);//

glTexCoord2f(0.0f, 0.0f); glVertex3f(-1.0f,-1.0f, 0.0f);

glTexCoord2f(1.0f, 0.0f); glVertex3f( 1.0f,-1.0f, 0.0f);

glTexCoord2f(1.0f, 1.0f); glVertex3f( 1.0f, 1.0f, 0.0f);

glTexCoord2f(0.0f, 1.0f); glVertex3f(-1.0f, 1.0f, 0.0f);

glEnd();//

}

. , , z.

glRotatef(spin,0.0f,0.0f,1.0f);// z

//

glColor4ub(star[loop].r,star[loop].g,star[loop].b,255);

glBegin(GL_QUADS);//

glTexCoord2f(0.0f, 0.0f); glVertex3f(-1.0f,-1.0f, 0.0f);

glTexCoord2f(1.0f, 0.0f); glVertex3f( 1.0f,-1.0f, 0.0f);

glTexCoord2f(1.0f, 1.0f); glVertex3f( 1.0f, 1.0f, 0.0f);

glTexCoord2f(0.0f, 1.0f); glVertex3f(-1.0f, 1.0f, 0.0f);

glEnd();//

. spin. . loop/num. . , . . .