2014年5月2日 星期五

茶壺轉轉轉

void display()
{
 glEnable(GL_DEPTH_TEST);
 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
 glPushMatrix();
  glRotatef(angleX, 0,1,0);
  glutWireTeapot(0.3);
 glPopMatrix();

 glPushMatrix();
  glRotatef(angleX, 0,1,0);
  glTranslatef(-0.5,0,0);
  glutSolidSphere(0.3,30,30);
 glPopMatrix();


 glPushMatrix();
     glRotatef(angleX, 0,1,0);
  glTranslatef(0.5,0,0);
  glutSolidSphere(0.3,30,30);
 glPopMatrix();

 glPushMatrix();
   glRotatef(angleX, 0,1,0);
 glTranslatef(0,0.5,0);
  glutSolidSphere(0.3,30,30);
 glPopMatrix();

 glPushMatrix();
  glRotatef(angleX, 0,1,0);
 glTranslatef(0,-0.5,0);
  glutSolidSphere(0.3,30,30);
 glPopMatrix();
 glutSwapBuffers();
}


沒有留言:

張貼留言