Advertisement
Guest User

Untitled

a guest
Apr 24th, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.96 KB | None | 0 0
  1. void drawer() {
  2.     glPushMatrix();
  3.        
  4.         /*bottom board*/
  5.         glPushMatrix();
  6.             Material(marron2, 0.25, 0.5, 0.25, 0., 1.);
  7.             glScalef(1.3, 0.7, 0.05);
  8.             cube();
  9.        
  10.         glPopMatrix();
  11.         Material(marron1, 0.25, 0.5, 0.25, 0., 1.);
  12.         /*left board*/
  13.         glPushMatrix();
  14.             glTranslatef(0., -0.65, 0.2);
  15.             glScalef(1.3, 0.05, 0.2);
  16.             cube();
  17.        
  18.         glPopMatrix();
  19.        
  20.         /*right board*/
  21.         glPushMatrix();
  22.             glTranslatef(0., 0.65, 0.2);
  23.             glScalef(1.3, 0.05, 0.2);
  24.             cube();
  25.         glPopMatrix();
  26.    
  27.         /*front board (volontarily bigger than the other ones)*/
  28.         glPushMatrix();
  29.             glTranslatef(1.3, 0., 0.2);
  30.             glScalef(0.05, 0.7, 0.25);
  31.             cube();
  32.         glPopMatrix();
  33.        
  34.         /*handle*/
  35.         glPushMatrix();
  36.             glTranslatef(1.4, 0., 0.2);
  37.             glScalef(0.1,0.1,0.1);
  38.             sphere(1.,20,20);
  39.         glPopMatrix();
  40.    
  41.    
  42.    
  43.     glPopMatrix();
  44.  
  45. }
  46.  
  47. void desk() {
  48.     glPushMatrix();
  49.         Material(marron1, 0.25, 0.5, 0.25, 0., 1.);
  50.         glTranslatef(-4.,0.,0.);
  51.         /*upper board*/
  52.         glPushMatrix();
  53.             glTranslatef(0., 0., 1.3);
  54.             glScalef(1.5, 3., 0.1);
  55.             cube();
  56.         glPopMatrix();
  57.        
  58.         /*back board*/
  59.         glPushMatrix();
  60.             glTranslatef(-1.385, 0., 0.2);
  61.             glScalef(0.1, 3., 1.17);
  62.             cube();
  63.         glPopMatrix();
  64.  
  65.  
  66.         /*left board*/
  67.         glPushMatrix();
  68.             glTranslatef(0., -3., 0.2);
  69.             glScalef(1.5, 0.1, 1.17);
  70.             cube();
  71.         glPopMatrix();
  72.  
  73.  
  74.         /*open drawer*/
  75.         glPushMatrix();
  76.             glTranslatef(1.3, 2.2, 0.75);
  77.             drawer();
  78.         glPopMatrix();
  79.        
  80.         /*closed one*/
  81.         glPushMatrix();
  82.             glTranslatef(0.25, 2.2, 0.2);
  83.             drawer();
  84.         glPopMatrix();
  85.        
  86.         /*drawer support*/
  87.         Material(marron1, 0.25, 0.5, 0.25, 0., 1.);
  88.         glPushMatrix();
  89.             glTranslatef(0., 3., 0.2);
  90.             glScalef(1.5, 0.1, 1.17);
  91.             cube();
  92.         glPopMatrix();
  93.        
  94.         glPushMatrix();
  95.             glTranslatef(0., 1.5, 0.2);
  96.             glScalef(1.5, 0.1, 1.17);
  97.             cube();
  98.         glPopMatrix();
  99.        
  100.         glPushMatrix();
  101.             glTranslatef(0., 2.2, -0.1);
  102.             glScalef(1.5, 0.8, 0.88);
  103.             cube();
  104.         glPopMatrix();
  105.        
  106.        
  107.     glPopMatrix();
  108. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement