Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.89 KB | None | 0 0
  1.  
  2. void drawEstantes(){
  3. //estante1
  4. glPushMatrix();
  5. glTranslated(5.3,5,14.2);
  6. glRotatef(90,0,1,0);
  7. glScaled(1.8, 0.3,4);
  8. glColor3f(0.1,0.5,1);
  9. glutSolidCube(1.0);
  10. glPopMatrix();
  11.  
  12. //estante2
  13.  
  14. glPushMatrix();
  15. glTranslated(14.2,13,-5.2);
  16. glScaled(1.8, 0.3,4);
  17. glColor3f(0.1,0.5,1);
  18. glutSolidCube(1.0);
  19. glPopMatrix();
  20.  
  21. //estante 3
  22. glPushMatrix();
  23. glTranslated(-5.2,21,-14.2);
  24. glRotatef(90,0,1,0);
  25. glScaled(1.8, 0.3,4);
  26. glColor3f(0.1,0.5,1);
  27. glutSolidCube(1.0);
  28. glPopMatrix();
  29.  
  30. }
  31.  
  32. void drawObjectos(){
  33.  
  34. //teapot
  35. glPushMatrix();
  36. glTranslated(5.5 ,5.5,14);
  37. glRotatef(90,0,1,0);
  38. glColor4f(1,1,1,0.7);
  39. glEnable(GL_TEXTURE_2D);
  40. glEnable(GL_BLEND);
  41. glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
  42. glutSolidTeapot(0.5);
  43. glPopMatrix();
  44. glDisable(GL_BLEND);
  45.  
  46.  
  47. //teapot 2 floor
  48. glPushMatrix();
  49. glTranslated(14.4 ,13.5,-5);
  50. glColor4f(1,1,1,0.7);
  51. glEnable(GL_TEXTURE_2D);
  52. glEnable(GL_BLEND);
  53. glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
  54. glutSolidTeapot(0.5);
  55. glPopMatrix();
  56. glDisable(GL_BLEND);
  57.  
  58. //teapot 3 floor
  59. glPushMatrix();
  60. glTranslated(-5.2, 21.5, -14.2);
  61. glRotatef(-90,0,1,0);
  62. glColor4f(1,1,1,0.7);
  63. glEnable(GL_TEXTURE_2D);
  64. glEnable(GL_BLEND);
  65. glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
  66. glutSolidTeapot(0.5);
  67. glPopMatrix();
  68. glDisable(GL_BLEND);
  69. }
  70.  
  71. void drawTrashCan()
  72. {
  73. //desenha da mesa
  74. GLUquadricObj *y = gluNewQuadric();
  75.  
  76. glEnable(GL_BLEND);
  77. glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
  78. //glColor4f(0.0f, 0.3f, 0.5f, 1.0f);
  79. glColor4f(0, 0.5, 1, 0.5);
  80.  
  81. glDisable(GL_TEXTURE_2D);
  82. glPushMatrix();
  83. glTranslatef(5.3, 0.1, 13.8);
  84. glRotatef(-90, 1, 0, 0);
  85. gluQuadricDrawStyle(y, GLU_FILL);
  86. gluQuadricNormals(y, GLU_SMOOTH);
  87. gluQuadricTexture(y, GL_TRUE);
  88. gluCylinder(y, 0.7, 1, 2, 100, 100);
  89. glPopMatrix();
  90.  
  91.  
  92. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement