Advertisement
Guest User

Untitled

a guest
Dec 12th, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.06 KB | None | 0 0
  1. void dimpryam()
  2. {
  3. if (k4 == 0)
  4. {
  5. glMatrixMode(GL_PROJECTION);
  6. glLoadIdentity();
  7. glOrtho(-150, 150, -150, 150, -200, 150);
  8. degree = 0;
  9. glRotatef(15, 1, 0, 0);
  10. glRotatef(degree, 0, -1, 0);
  11. k4++;
  12. }
  13. glRotatef(alpha, 0, -1, 0);
  14. glRotatef(degree, 0, 1, 0);
  15.  
  16. glColor3f(0.8, 0.8, 0.8);
  17. glBegin(GL_LINES);
  18. glVertex3f(0, -50, 0);
  19. glVertex3f(-100, -50, 60);
  20. glVertex3f(0, -50, 0);
  21. glVertex3f(60, -50, 100);
  22.  
  23. glVertex3f(0, -50, 0);
  24. glVertex3f(0, 100, 0);
  25. glEnd();
  26. glRotatef(degree, 0, -1, 0);
  27.  
  28.  
  29. //glBegin(GL_LINE_STRIP);
  30. glBegin(GL_LINES);
  31. if (degree >= 0 && degree < 90 || degree > 270 && degree < 360)
  32. {
  33.  
  34. glColor3f(0.5, 0.5, 0.5);
  35. }
  36. else if (degree >= 90 && degree <= 270)
  37.  
  38. glColor3f(1.0, 0.0, 0.0);
  39.  
  40. glVertex3f(-50, -50, -50);
  41. glVertex3f(50, -50, -50);
  42.  
  43. if (degree >= 0 && degree <= 270)
  44. {
  45. /*if (degree == 180)
  46. glColor3f(1.0, 0.0, 0.0);
  47. else*/
  48. glColor3f(1.0, 0.0, 0.0);
  49.  
  50. }
  51. else if (degree > 270 && degree < 360)
  52. glColor3f(0.5, 0.5, 0.5);
  53.  
  54. glVertex3f(50, -50, -50);
  55. glVertex3f(50, 50, -50);
  56.  
  57. /*if (degree > 0 && degree < 90 || degree > 270 && degree < 360)
  58. {
  59. if (degree == 180)
  60. glColor3f(1.0, 0.0, 0.0);
  61. else
  62. glColor3f(0.5, 0.5, 0.5);
  63. }
  64. else if (degree >= 90 && degree <= 270)*/
  65. glColor3f(1.0, 0.0, 0.0);
  66.  
  67. glVertex3f(50, 50, -50);
  68. glVertex3f(-50, 50, -50);
  69.  
  70. if (degree > 0 && degree < 90)
  71. {
  72.  
  73. glColor3f(0.5, 0.5, 0.5);
  74. }
  75. else
  76. glColor3f(1.0, 0.0, 0.0);
  77.  
  78. glVertex3f(-50, 50, -50);
  79. glVertex3f(-50, -50, -50);
  80. glEnd();
  81.  
  82.  
  83.  
  84.  
  85. //glBegin(GL_LINE_STRIP);
  86. glBegin(GL_LINES);
  87. if (degree >= 270 && degree < 360 || degree >= 0 && degree <= 90)
  88. {
  89. glColor3f(1.0, 0.0, 0.0);
  90. }
  91. else
  92. glColor3f(0.5, 0.5, 0.5);
  93.  
  94. glVertex3f(-50, -50, 50);
  95. glVertex3f(50, -50, 50);
  96.  
  97.  
  98. if (degree >= 270 && degree < 360 || degree >= 0 && degree <= 180)
  99. {
  100. glColor3f(1.0, 0.0, 0.0);
  101. }
  102. else
  103. glColor3f(0.5, 0.5, 0.5);
  104. glVertex3f(50, -50, 50);
  105. glVertex3f(50, 50, 50);
  106.  
  107.  
  108. /*if (degree >=0 && degree <= 90 || degree >= 270 && degree <= 360)
  109. {
  110. glColor3f(1.0, 0.0, 0.0);
  111. }
  112. else if (degree > 90 && degree < 270)
  113. if (degree == 180)*/
  114. glColor3f(1.0, 0.0, 0.0);
  115. /*else
  116. glColor3f(0.5, 0.5, 0.5);*/
  117. glVertex3f(50, 50, 50);
  118. glVertex3f(-50, 50, 50);
  119.  
  120.  
  121. if (degree > 90 && degree < 180)
  122. {
  123. glColor3f(0.5, 0.5, 0.5);
  124. }
  125. else glColor3f(1.0, 0.0, 0.0);
  126.  
  127. glVertex3f(-50, 50, 50);
  128. glVertex3f(-50, -50, 50);
  129. glEnd();
  130.  
  131. //glBegin(GL_LINE_STRIP);
  132. ////glBegin(GL_LINES);
  133. //glColor3f(1.0, 0.0, 0.0);
  134.  
  135.  
  136.  
  137.  
  138. glBegin(GL_LINES);
  139. if (degree > 0 && degree < 180)
  140. {
  141. glColor3f(0.5, 0.5, 0.5);
  142. }
  143. else
  144. glColor3f(1.0, 0.0, 0.0);
  145.  
  146. glVertex3f(-50, -50, 50);
  147. glVertex3f(-50, -50, -50);
  148.  
  149.  
  150. if (degree >= 0 && degree <= 180)
  151. {
  152. glColor3f(1.0, 0.0, 0.0);
  153. }
  154. else glColor3f(0.5, 0.5, 0.5);
  155.  
  156. glVertex3f(50, -50, 50);
  157. glVertex3f(50, -50, -50);
  158.  
  159. glColor3f(1.0, 0.0, 0.0);
  160.  
  161. glVertex3f(50, 50, 50);
  162. glVertex3f(50, 50, -50);
  163.  
  164. glColor3f(1.0, 0.0, 0.0);
  165.  
  166. glVertex3f(-50, 50, 50);
  167. glVertex3f(-50, 50, -50);
  168. glEnd();
  169.  
  170.  
  171. glFlush();
  172. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement