Quelques exemples d'objets hiérarchisés

previoustopnext

glPushMatrix();
  glutWireSphere(1.0); /* draw sun */ 
  glRotatef ((GLfloat) year, 0.0, 1.0, 0.0); 
  glTranslatef (2.0, 0.0, 0.0); 
  glRotatef ((GLfloat) day, 0.0, 1.0, 0.0); 
  glutWireSphere(0.2); /* draw smaller planet */ 
  glPopMatrix(); 
 

Michel Buffa

ESSI