Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void drawer() {
- glPushMatrix();
- /*bottom board*/
- glPushMatrix();
- Material(marron2, 0.25, 0.5, 0.25, 0., 1.);
- glScalef(1.3, 0.7, 0.05);
- cube();
- glPopMatrix();
- Material(marron1, 0.25, 0.5, 0.25, 0., 1.);
- /*left board*/
- glPushMatrix();
- glTranslatef(0., -0.65, 0.2);
- glScalef(1.3, 0.05, 0.2);
- cube();
- glPopMatrix();
- /*right board*/
- glPushMatrix();
- glTranslatef(0., 0.65, 0.2);
- glScalef(1.3, 0.05, 0.2);
- cube();
- glPopMatrix();
- /*front board (volontarily bigger than the other ones)*/
- glPushMatrix();
- glTranslatef(1.3, 0., 0.2);
- glScalef(0.05, 0.7, 0.25);
- cube();
- glPopMatrix();
- /*handle*/
- glPushMatrix();
- glTranslatef(1.4, 0., 0.2);
- glScalef(0.1,0.1,0.1);
- sphere(1.,20,20);
- glPopMatrix();
- glPopMatrix();
- }
- void desk() {
- glPushMatrix();
- Material(marron1, 0.25, 0.5, 0.25, 0., 1.);
- glTranslatef(-4.,0.,0.);
- /*upper board*/
- glPushMatrix();
- glTranslatef(0., 0., 1.3);
- glScalef(1.5, 3., 0.1);
- cube();
- glPopMatrix();
- /*back board*/
- glPushMatrix();
- glTranslatef(-1.385, 0., 0.2);
- glScalef(0.1, 3., 1.17);
- cube();
- glPopMatrix();
- /*left board*/
- glPushMatrix();
- glTranslatef(0., -3., 0.2);
- glScalef(1.5, 0.1, 1.17);
- cube();
- glPopMatrix();
- /*open drawer*/
- glPushMatrix();
- glTranslatef(1.3, 2.2, 0.75);
- drawer();
- glPopMatrix();
- /*closed one*/
- glPushMatrix();
- glTranslatef(0.25, 2.2, 0.2);
- drawer();
- glPopMatrix();
- /*drawer support*/
- Material(marron1, 0.25, 0.5, 0.25, 0., 1.);
- glPushMatrix();
- glTranslatef(0., 3., 0.2);
- glScalef(1.5, 0.1, 1.17);
- cube();
- glPopMatrix();
- glPushMatrix();
- glTranslatef(0., 1.5, 0.2);
- glScalef(1.5, 0.1, 1.17);
- cube();
- glPopMatrix();
- glPushMatrix();
- glTranslatef(0., 2.2, -0.1);
- glScalef(1.5, 0.8, 0.88);
- cube();
- glPopMatrix();
- glPopMatrix();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement