Ejemplo n.º 1
0
/*! Un second lot d'objets : 1 table, 1 théière, 4 chaises !*/  
static void lot2(void)
{
  glPushMatrix();
    /* une table */
    table(0);
    /* une coupe avec des fruits */
    glPushMatrix();
      glTranslatef(0.5,0.2,+2.1);
      glRotatef(60.,0.,0.,1.);
      plat();
    glPopMatrix();
    /* 3 chaises */
    glPushMatrix();
      glTranslatef(-1.75,0.,0.);
      glRotatef(40.,0.,0.,1.);
      Material(bleu,0.25,0.5,0.0,1.0,1.);
      chaise(1);
    glPopMatrix();
    glPushMatrix();
      glTranslatef(0.,-1.2,0.);
      glRotatef(100.,0.,0.,1.);
      Material(rouge,0.25,0.5,0.0,1.0,1.);
      chaise(0);
    glPopMatrix();    
    glPushMatrix();
      glTranslatef(+2.5,0.,0.);
      glRotatef(140.,0.,0.,1.);
      Material(vert,0.25,0.5,0.0,1.0,1.);
      chaise(0);
    glPopMatrix();
  glPopMatrix();
}
Ejemplo n.º 2
0
/*! Un premier lot d'objets : 1 table, 1 coupe de fruits, 3 chaises !*/  
static void lot1(void)
{
  glPushMatrix();
    /* une table */
    table(1);
    /* une theière, posée sur la table */
    glPushMatrix();
      glTranslatef(0.,0.,2.);
      glRotatef(120.,0.,0.,1.);
      teapot();
    glPopMatrix();

    /* 4 chaises */
    glPushMatrix();
      glTranslatef(-1.5,0.,0.);
      Material(rouge,0.25,0.5,0.0,1.0,1.);
      chaise(0);
    glPopMatrix();
    glPushMatrix();
      glTranslatef(0.,-0.8,0.);
      glRotatef(70.,0.,0.,1.);
      Material(vert,0.25,0.5,0.0,1.0,1.);
      chaise(1);
    glPopMatrix();
    glPushMatrix();
      glTranslatef(0.,+0.8,0.);
      glRotatef(-80.,0.,0.,1.);
      Material(bleu,0.25,0.5,0.0,1.0,1.);
      chaise(0);
    glPopMatrix();
    
    glPushMatrix();
      glTranslatef(+1.5,0.,0.);
      glRotatef(170.,0.,0.,1.);
      Material(cyan,0.25,0.5,0.0,1.0,1.);
      chaise(1);
    glPopMatrix();
		
		/* 4 verres */
    Material(glass,0.6,0.85,0.5,1.0,0.5);
    glPushMatrix();
      glTranslatef(-1.4,0.,+2.01);
      verre();
    glPopMatrix();
    glPushMatrix();
      glTranslatef(0.,-0.75,+2.01);
      verre();
    glPopMatrix();
    glPushMatrix();
      glTranslatef(0.,+0.75,+2.01);
      verre();
    glPopMatrix();
    glPushMatrix();
      glTranslatef(+1.4,0.,+2.01);
      verre();
    glPopMatrix();
  glPopMatrix();
}
Ejemplo n.º 3
0
Object* enstabcha(glm::vec3 pos)
{
	Container* m;
	Container* c = new Container(pos);
	m = static_cast<Container*>(table());
	c->addObject(m);

	m = static_cast<Container*>(chaise(glm::vec3(0.0,4.0,0.0)));
	m->rotate(180,glm::vec3(0,0,1));
	c->addObject(m);

	m = static_cast<Container*>(chaise(glm::vec3(0.0,-4.0,0.0)));
	c->addObject(m);
	return c;
}