#include<GL/glut.h>
void display()
{
glPushMatrix();
glPushMatrix();
glTranslatef(0,0.3,0);
glColor3f(0,0,1);
glutSolidSphere(0.3,30,30);
glColor3f(1,1,1);
glTranslatef(0,-0.1,0.1);
glutSolidSphere(0.25,30,30);
glPopMatrix();
glPushMatrix();
glColor3f(1,1,1);
//glutSolidSphere(0.2,30,30);
glPopMatrix();
glutSwapBuffers();
}
int main()
{
glutInitDisplayMode(GLUT_DOUBLE|GLUT_DEPTH);
glutCreateWindow("week08");
glutDisplayFunc(display);
glutMainLoop();
}
沒有留言:
張貼留言