Advertisement
Guest User

Untitled

a guest
Dec 7th, 2016
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. void drawCube(POLYGON cube) {
  2. //std::cout << __func__ << std::endl;
  3. glColor3f(BLACK);
  4. glBegin(GL_LINE_LOOP);
  5. for(int i = 0 ; i < 4 ; i++){
  6. glVertex2d(cube.P[i].x, cube.P[i].y);
  7. //printf("%.d cube %d. part %d. points (%.0f, %.0f)\n",qq, q, i, cube[q].P[i].x, cube[q].P[i].y);
  8. }
  9. glEnd();
  10. glBegin(GL_LINE_LOOP);
  11. for(int i = 4 ; i < 8 ; i++)
  12. glVertex2d(cube.P[i].x, cube.P[i].y);
  13. glEnd();
  14. glBegin(GL_LINES);
  15. glVertex2d(cube.P[0].x, cube.P[0].y);
  16. glVertex2d(cube.P[4].x, cube.P[4].y);
  17.  
  18. glVertex2d(cube.P[1].x, cube.P[1].y);
  19. glVertex2d(cube.P[5].x, cube.P[5].y);
  20.  
  21. glVertex2d(cube.P[2].x, cube.P[2].y);
  22. glVertex2d(cube.P[6].x, cube.P[6].y);
  23.  
  24. glVertex2d(cube.P[3].x, cube.P[3].y);
  25. glVertex2d(cube.P[7].x, cube.P[7].y);
  26. glEnd();
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement