L'exécutable

TD01-03.png  TD01-03b.png 

TD01-04.png  TD01-04b.png 

Fichier source : BrasRobotPartiel.cpp
Modules utilitaires

/* Scene dessinee avec des cubes                */

static void scene5() {
  glPushMatrix();
  glRotatef(r1,0.0F,1.0F,0.0F);
  glTranslatef(1.5F,0.0F,0.0F);
  glPushMatrix();
  glScalef(3.0F,1.0F,1.0F);
  glutSolidCube(1.0);
  glPopMatrix();
  glTranslatef(1.5F,0.0F,0.0F);
  glRotatef(r2,0.0F,1.0F,0.0F);
  glTranslatef(1.5F,0.0F,0.0F);
  glPushMatrix();
  glScalef(3.0F,0.8F,0.8F);
  glutSolidCube(1.0);
  glPopMatrix();
  glPopMatrix();
}

/* Scene dessinee avec des cylindres            */

static void cylindre(double h,double r,int n,int m) {
  glPushMatrix();
  glRotatef(90.0F,1.0F,0.0F,0.0F);
  glTranslatef(0.0F,0.0F,-h/2);
  GLUquadricObj *qobj = gluNewQuadric();
  gluQuadricDrawStyle(qobj,GLU_FILL);
  gluCylinder(qobj,r,r,h,n,m);
  gluDeleteQuadric(qobj);  
  glPopMatrix();
}

static void scene6() {
  glPushMatrix();
  glRotatef(r1,0.0F,1.0F,0.0F);
  glTranslatef(1.5F,0.0F,0.0F);
  glPushMatrix();
  glRotatef(90.0F,0.0F,0.0F,1.0F);
  cylindre(3.0,0.5,12,12);
  glPopMatrix();
  glTranslatef(1.5F,0.0F,0.0F);
  glRotatef(r2,0.0F,1.0F,0.0F);
  glTranslatef(1.5F,0.0F,0.0F);
  glPushMatrix();
  glRotatef(90.0F,0.0F,0.0F,1.0F);
  cylindre(3.0,0.4,12,12);
  glPopMatrix();
  glPopMatrix();
}

RETOUR