Advertisement
Guest User

Untitled

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