Advertisement
Guest User

Untitled

a guest
Jul 27th, 2017
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1. for (int i=0; i<12; i++) {
  2. Mesh_tile *t = &main_mesh->tile[i];
  3. if (t->projection->visible) {
  4. glColor3f(t->projection->colour[0], t->projection->colour[1], t->projection->colour[2]);
  5. Vector2 *c[5] = {&t->corner[0]->projection->v, &t->corner[1]->projection->v, &t->corner[2]->projection->v, &t->corner[3]->projection->v, &t->corner[4]->projection->v};
  6. glBegin(GL_TRIANGLE_FAN);
  7. glVertex2f(t->projection->v.x, t->projection->v.y);
  8. glVertex2f(c[0]->x, c[0]->y);
  9. glVertex2f(c[1]->x, c[1]->y);
  10. glVertex2f(c[2]->x, c[2]->y);
  11. glVertex2f(c[3]->x, c[3]->y);
  12. glVertex2f(c[4]->x, c[4]->y);
  13. glVertex2f(c[0]->x, c[0]->y);
  14. glEnd();
  15. }
  16. }
  17. for (int i=12; i<main_mesh->tiles; i++) {
  18. Mesh_tile *t = &main_mesh->tile[i];
  19. if (t->projection->visible) {
  20. glColor3f(t->projection->colour[0], t->projection->colour[1], t->projection->colour[2]);
  21. Vector2 *c[6] = {&t->corner[0]->projection->v, &t->corner[1]->projection->v, &t->corner[2]->projection->v, &t->corner[3]->projection->v, &t->corner[4]->projection->v, &t->corner[5]->projection->v};
  22. glBegin(GL_TRIANGLE_FAN);
  23. glVertex2f(t->projection->v.x, t->projection->v.y);
  24. glVertex2f(c[0]->x, c[0]->y);
  25. glVertex2f(c[1]->x, c[1]->y);
  26. glVertex2f(c[2]->x, c[2]->y);
  27. glVertex2f(c[3]->x, c[3]->y);
  28. glVertex2f(c[4]->x, c[4]->y);
  29. glVertex2f(c[5]->x, c[5]->y);
  30. glVertex2f(c[0]->x, c[0]->y);
  31. glEnd();
  32. }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement