Advertisement
Guest User

Untitled

a guest
Apr 1st, 2020
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. void linie() {
  2.  
  3. for (int i = 0; i <8; i++) {
  4.  
  5. if ((i+1)%4!=0) {
  6. glPushMatrix();
  7. glBegin(GL_LINES);
  8. glColor3f(0, 0, 1);
  9. glVertex3f(p[i][0], p[i][1], p[i][2]);
  10. glVertex3f(p[i + 1][0], p[i + 1][1], p[i + 1][2]);
  11. glEnd();
  12. glPopMatrix();
  13.  
  14.  
  15. }
  16. else if((i+1)%4==0){
  17. glPushMatrix();
  18. glBegin(GL_LINES);
  19. glColor3f(0, 1, 0);
  20. glVertex3f(p[i][0], p[i][1], p[i][2]);
  21. glVertex3f(p[i - 3][0], p[i - 3][1], p[i - 3][2]);
  22. glEnd();
  23. glPopMatrix();
  24. }
  25.  
  26. }
  27. for (int i = 0; i < 4; i++) {
  28. glPushMatrix();
  29. glBegin(GL_LINES);
  30. glColor3f(1, 0, 0);
  31. glVertex3f(p[i][0], p[i][1], p[i][2]);
  32. glVertex3f(p[i + 4][0], p[i + 4][1], p[i + 4][2]);
  33. glEnd();
  34. glPopMatrix();
  35.  
  36. }
  37.  
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement