L'exécutable

     

     

Fichier source : Epreuve1.cpp

static void carreTroue(double c) {
  float c2 =(float) c/2.0;
  float c4 =(float) c/4.0;
  glNormal3f(0.0F,0.0F,1.0F);
  glBegin(GL_QUAD_STRIP);
  glVertex3f( c2, c2,0.0F);
  glVertex3f( c4, c4,0.0F);
  glVertex3f( c2,-c2,0.0F);
  glVertex3f( c4,-c4,0.0F);
  glVertex3f(-c2,-c2,0.0F);
  glVertex3f(-c4,-c4,0.0F);
  glVertex3f(-c2, c2,0.0F);
  glVertex3f(-c4, c4,0.0F);
  glVertex3f( c2, c2,0.0F);
  glVertex3f( c4, c4,0.0F);
  glEnd();
}

static void mySolidBox(double largeur,double hauteur,double profondeur) {
  glPushMatrix();
  glScalef(largeur,hauteur,profondeur);
  glutSolidCube(1.0);
  glPopMatrix();
}

static void structureElementaire(void) {
  glPushMatrix();
  glPushMatrix();
  glTranslatef(5.0F,0.0F,5.0F);
  mySolidBox(2.0F,12.0F,2.0F);
  glPopMatrix();
  glPushMatrix();
  glTranslatef(0.0F,5.0F,5.0F);
  mySolidBox(8.0F,2.0F,2.0F);
  glPopMatrix();
  glPushMatrix();
  glTranslatef(0.0F,-5.0F,5.0F);
  mySolidBox(8.0F,2.0F,2.0F);
  glPopMatrix();
  glPopMatrix();
}

static void cubeStylise(void) {
  glPushMatrix();
  structureElementaire();
  glRotatef(90.0F,0.0F,1.0F,0.0F);
  structureElementaire();
  glRotatef(90.0F,0.0F,1.0F,0.0F);
  structureElementaire();
  glRotatef(90.0F,0.0F,1.0F,0.0F);
  structureElementaire();
  glPopMatrix();
}

RETOUR