Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void box(Vector fLeft, float radius, Color c)
- {
- float x, y, z;
- x = fLeft.x;
- y = fLeft.y;
- z = fLeft.z;
- //front face
- Plane *front = new Plane(fLeft, Vector(x, y+radius, z),
- Vector(x+radius, y+radius, z), Vector(x+radius, y, z), c);
- sceneObjects.push_back(front);
- //left face
- Plane *left = new Plane(Vector(x, y, z+radius), Vector(x, y+radius, z+radius),
- Vector(x, y+radius, z), fLeft, c);
- sceneObjects.push_back(left);
- //back face
- Plane *back = new Plane(Vector(x+radius, y, z+radius), Vector(x+radius, y+radius, z+radius),
- Vector(x, y+radius, z+radius), Vector(x, y, z+radius), c);
- sceneObjects.push_back(back);
- //right face
- Plane *right = new Plane(Vector(x+radius, y, z), Vector(x+radius, y+radius, z),
- Vector(x+radius, y+radius, z+radius), Vector(x+radius, y, z+radius), c);
- sceneObjects.push_back(right);
- //bottom face
- Plane *floor = new Plane(Vector(x, y, z+radius), fLeft,
- Vector(x+radius, y, z+radius), Vector(x+radius, y, z), c);
- sceneObjects.push_back(floor);
- //top face
- Plane *roof = new Plane(Vector(x, y+radius, z), Vector(x, y+radius, z+radius),
- Vector(x+radius, y+radius, z+radius), Vector(x+radius, y+radius, z), c);
- sceneObjects.push_back(roof);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement