Advertisement
Guest User

Untitled

a guest
Dec 12th, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.31 KB | None | 0 0
  1. // Przygotowanie stosu macierzy modelowania
  2. glPushMatrix();
  3.  
  4. // Rysowanie podstawy dzwigu bez slupow
  5. glPushMatrix();
  6. glScalef(6.0,1.0,6.0);
  7. glTranslatef(0.0, 2.5, 0.0);
  8. glutWireCube(1.0);
  9.  
  10. glPopMatrix();
  11. // Rysowanie podstawy
  12. glPushMatrix();
  13. glTranslatef(1.75,2.0,1.75);
  14. glRotatef(90.0,1,0,0);
  15. gluCylinder(podstawaSlup1, 0.5, 0.5, 2.0, 16, 3);
  16. glTranslatef(-3.5,0.0,0.0);
  17. gluCylinder(podstawaSlup2, 0.5, 0.5, 2.0, 16, 3);
  18. glTranslatef(0.0,-3.5,0.0);
  19. gluCylinder(podstawaSlup2, 0.5, 0.5, 2.0, 16, 3);
  20. glTranslatef(3.5,0.0,0.0);
  21. gluCylinder(podstawaSlup2, 0.5, 0.5, 2.0, 16, 3);
  22. glPopMatrix();
  23.  
  24. glPushMatrix();
  25. //rysowanie slupa
  26. glTranslatef(0.0,9.0,0.0);
  27. glRotatef(90.0,1,0,0);
  28. gluCylinder(konstrukcjaDzwigu, 0.625, 0.625, 6.0, 16, 3);
  29. glPopMatrix();
  30.  
  31. glPushMatrix();
  32. //rysowanie wspornikow
  33. glTranslatef(-1.25,4.2,0.0);
  34. glRotatef(60.0,0,0,1);
  35. glScalef(3.0,0.25,0.25);
  36. glutWireCube(1.0);
  37. glPopMatrix();
  38. glPushMatrix();
  39. //rysowanie wspornikow
  40. glTranslatef(1.25,4.2,0.0);
  41. glRotatef(-60.0,0,0,1);
  42. glScalef(3.0,0.25,0.25);
  43. glutWireCube(1.0);
  44. glPopMatrix();
  45. glPushMatrix();
  46. //rysowanie wspornikow
  47. glTranslatef(0.0,4.2,-1.25);
  48. glRotatef(30.0,1,0,0);
  49. glScalef(0.25,3.0,0.25);
  50. glutWireCube(1.0);
  51. glPopMatrix();
  52. glPushMatrix();
  53. //rysowanie wspornikow
  54. glTranslatef(0.0,4.2,1.25);
  55. glRotatef(-30.0,1,0,0);
  56. glScalef(0.25,3.0,0.25);
  57. glutWireCube(1.0);
  58. glPopMatrix();
  59.  
  60. glPushMatrix();
  61. glTranslatef(0.0,9.25,-0.55);
  62. gluCylinder(polaczenieRamienia,0.75,0.75,1.25,16,3);
  63. glPopMatrix();
  64.  
  65. glPushMatrix();
  66. glRotatef(90.0,0,1,0);
  67. glTranslatef(0.0,9.3,0.25);
  68. gluCylinder(ramieDzwigu,0.4,0.4,7.5,16,3);
  69. glPopMatrix();
  70.  
  71. glPushMatrix();
  72. glTranslatef(7.65,9.3,-0.4);
  73. gluCylinder(zaczepLiny,0.4,0.4,0.8,16,3);
  74. glPopMatrix();
  75.  
  76. glPushMatrix();
  77. glTranslatef(7.65,9.0,0.0);
  78. glRotatef(90.0,1,0,0);
  79. gluCylinder(lina,0.01,0.01,4.0,16,3);
  80. glPopMatrix();
  81.  
  82. glPushMatrix();
  83. glTranslatef(7.65,4.0,0.0);
  84. glutWireSphere(1.0,16,16);
  85. glPopMatrix();
  86. // Posprzatanie na stosie macierzy modelowania
  87. glPopMatrix();
  88. // Przygotowanie stosu macierzy modelowania
  89. glPushMatrix();
  90.  
  91. // Rysowanie podstawy dzwigu bez slupow
  92. glPushMatrix();
  93. glScalef(6.0,1.0,6.0);
  94. glTranslatef(0.0, 2.5, 0.0);
  95. glutWireCube(1.0);
  96.  
  97. glPopMatrix();
  98. // Rysowanie podstawy
  99. glPushMatrix();
  100. glTranslatef(1.75,2.0,1.75);
  101. glRotatef(90.0,1,0,0);
  102. gluCylinder(podstawaSlup1, 0.5, 0.5, 2.0, 16, 3);
  103. glTranslatef(-3.5,0.0,0.0);
  104. gluCylinder(podstawaSlup2, 0.5, 0.5, 2.0, 16, 3);
  105. glTranslatef(0.0,-3.5,0.0);
  106. gluCylinder(podstawaSlup2, 0.5, 0.5, 2.0, 16, 3);
  107. glTranslatef(3.5,0.0,0.0);
  108. gluCylinder(podstawaSlup2, 0.5, 0.5, 2.0, 16, 3);
  109. glPopMatrix();
  110.  
  111. glPushMatrix();
  112. //rysowanie slupa
  113. glTranslatef(0.0,9.0,0.0);
  114. glRotatef(90.0,1,0,0);
  115. gluCylinder(konstrukcjaDzwigu, 0.625, 0.625, 6.0, 16, 3);
  116. glPopMatrix();
  117.  
  118. glPushMatrix();
  119. //rysowanie wspornikow
  120. glTranslatef(-1.25,4.2,0.0);
  121. glRotatef(60.0,0,0,1);
  122. glScalef(3.0,0.25,0.25);
  123. glutWireCube(1.0);
  124. glPopMatrix();
  125. glPushMatrix();
  126. //rysowanie wspornikow
  127. glTranslatef(1.25,4.2,0.0);
  128. glRotatef(-60.0,0,0,1);
  129. glScalef(3.0,0.25,0.25);
  130. glutWireCube(1.0);
  131. glPopMatrix();
  132. glPushMatrix();
  133. //rysowanie wspornikow
  134. glTranslatef(0.0,4.2,-1.25);
  135. glRotatef(30.0,1,0,0);
  136. glScalef(0.25,3.0,0.25);
  137. glutWireCube(1.0);
  138. glPopMatrix();
  139. glPushMatrix();
  140. //rysowanie wspornikow
  141. glTranslatef(0.0,4.2,1.25);
  142. glRotatef(-30.0,1,0,0);
  143. glScalef(0.25,3.0,0.25);
  144. glutWireCube(1.0);
  145. glPopMatrix();
  146.  
  147. glPushMatrix();
  148. glTranslatef(0.0,9.25,-0.55);
  149. gluCylinder(polaczenieRamienia,0.75,0.75,1.25,16,3);
  150. glPopMatrix();
  151.  
  152. glPushMatrix();
  153. glRotatef(90.0,0,1,0);
  154. glTranslatef(0.0,9.3,0.25);
  155. gluCylinder(ramieDzwigu,0.4,0.4,7.5,16,3);
  156. glPopMatrix();
  157.  
  158. glPushMatrix();
  159. glTranslatef(7.65,9.3,-0.4);
  160. gluCylinder(zaczepLiny,0.4,0.4,0.8,16,3);
  161. glPopMatrix();
  162.  
  163. glPushMatrix();
  164. glTranslatef(7.65,9.0,0.0);
  165. glRotatef(90.0,1,0,0);
  166. gluCylinder(lina,0.01,0.01,4.0,16,3);
  167. glPopMatrix();
  168.  
  169. glPushMatrix();
  170. glTranslatef(7.65,4.0,0.0);
  171. glutWireSphere(1.0,16,16);
  172. glPopMatrix();
  173. // Posprzatanie na stosie macierzy modelowania
  174. glPopMatrix();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement