Advertisement
Guest User

Untitled

a guest
May 31st, 2016
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. void box(Vector fLeft, float radius, Color c)
  2. {
  3.  
  4. float x, y, z;
  5. x = fLeft.x;
  6. y = fLeft.y;
  7. z = fLeft.z;
  8. //front face
  9. Plane *front = new Plane(fLeft, Vector(x, y+radius, z),
  10. Vector(x+radius, y+radius, z), Vector(x+radius, y, z), c);
  11. sceneObjects.push_back(front);
  12. //left face
  13. Plane *left = new Plane(Vector(x, y, z+radius), Vector(x, y+radius, z+radius),
  14. Vector(x, y+radius, z), fLeft, c);
  15. sceneObjects.push_back(left);
  16. //back face
  17. Plane *back = new Plane(Vector(x+radius, y, z+radius), Vector(x+radius, y+radius, z+radius),
  18. Vector(x, y+radius, z+radius), Vector(x, y, z+radius), c);
  19. sceneObjects.push_back(back);
  20. //right face
  21. Plane *right = new Plane(Vector(x+radius, y, z), Vector(x+radius, y+radius, z),
  22. Vector(x+radius, y+radius, z+radius), Vector(x+radius, y, z+radius), c);
  23. sceneObjects.push_back(right);
  24. //bottom face
  25. Plane *floor = new Plane(Vector(x, y, z+radius), fLeft,
  26. Vector(x+radius, y, z+radius), Vector(x+radius, y, z), c);
  27. sceneObjects.push_back(floor);
  28. //top face
  29. Plane *roof = new Plane(Vector(x, y+radius, z), Vector(x, y+radius, z+radius),
  30. Vector(x+radius, y+radius, z+radius), Vector(x+radius, y+radius, z), c);
  31. sceneObjects.push_back(roof);
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement