summaryrefslogtreecommitdiffstats
path: root/Cuboid.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Cuboid.cpp')
-rw-r--r--Cuboid.cpp32
1 files changed, 14 insertions, 18 deletions
diff --git a/Cuboid.cpp b/Cuboid.cpp
index ed0de5d..5b1af49 100644
--- a/Cuboid.cpp
+++ b/Cuboid.cpp
@@ -68,19 +68,19 @@ std::list<Triangle> Cuboid::getTriangles(/*const Matrix &modelview*/)
vmml::vec4f c(0.0, 0.0, 1.0, 0.5);
triangles.push_back(Triangle(vmml::vec3f(x-width/2, y+height/2, z+depth/2),
- vmml::vec3f(x+width/2, y+height/2, z+depth/2),
- vmml::vec3f(x-width/2, y-height/2, z+depth/2), c));
+ vmml::vec3f(x-width/2, y-height/2, z+depth/2),
+ vmml::vec3f(x+width/2, y+height/2, z+depth/2), c));
triangles.push_back(Triangle(vmml::vec3f(x-width/2, y-height/2, z+depth/2),
- vmml::vec3f(x+width/2, y+height/2, z+depth/2),
- vmml::vec3f(x+width/2, y-height/2, z+depth/2), c));
+ vmml::vec3f(x+width/2, y-height/2, z+depth/2),
+ vmml::vec3f(x+width/2, y+height/2, z+depth/2), c));
// Back face
c = vmml::vec4f(1.0, 1.0, 0.0, 0.5);
triangles.push_back(Triangle(vmml::vec3f(x-width/2, y+height/2, z-depth/2),
- vmml::vec3f(x-width/2, y-height/2, z-depth/2),
- vmml::vec3f(x+width/2, y+height/2, z-depth/2), c));
+ vmml::vec3f(x+width/2, y+height/2, z-depth/2),
+ vmml::vec3f(x-width/2, y-height/2, z-depth/2), c));
triangles.push_back(Triangle(vmml::vec3f(x-width/2, y-height/2, z-depth/2),
vmml::vec3f(x+width/2, y+height/2, z-depth/2),
@@ -90,12 +90,12 @@ std::list<Triangle> Cuboid::getTriangles(/*const Matrix &modelview*/)
c = vmml::vec4f(0.0, 1.0, 0.0, 0.5);
triangles.push_back(Triangle(vmml::vec3f(x-width/2, y+height/2, z+depth/2),
- vmml::vec3f(x-width/2, y-height/2, z+depth/2),
- vmml::vec3f(x-width/2, y+height/2, z-depth/2), c));
-
- triangles.push_back(Triangle(vmml::vec3f(x-width/2, y-height/2, z-depth/2),
vmml::vec3f(x-width/2, y+height/2, z-depth/2),
vmml::vec3f(x-width/2, y-height/2, z+depth/2), c));
+
+ triangles.push_back(Triangle(vmml::vec3f(x-width/2, y-height/2, z-depth/2),
+ vmml::vec3f(x-width/2, y-height/2, z+depth/2),
+ vmml::vec3f(x-width/2, y+height/2, z-depth/2), c));
// Right face
@@ -121,16 +121,12 @@ std::list<Triangle> Cuboid::getTriangles(/*const Matrix &modelview*/)
// Bottom face
triangles.push_back(Triangle(vmml::vec3f(x-width/2, y-height/2, z+depth/2),
- vmml::vec3f(x+width/2, y-height/2, z+depth/2),
- vmml::vec3f(x-width/2, y-height/2, z-depth/2), c));
+ vmml::vec3f(x-width/2, y-height/2, z-depth/2),
+ vmml::vec3f(x+width/2, y-height/2, z+depth/2), c));
triangles.push_back(Triangle(vmml::vec3f(x+width/2, y-height/2, z+depth/2),
- vmml::vec3f(x+width/2, y-height/2, z-depth/2),
- vmml::vec3f(x-width/2, y-height/2, z-depth/2), c));
-
- /*for(std::list<Triangle>::iterator t = triangles.begin(); t != triangles.end(); ++t) {
- t->transform(modelview);
- }*/
+ vmml::vec3f(x-width/2, y-height/2, z-depth/2),
+ vmml::vec3f(x+width/2, y-height/2, z-depth/2), c));
return triangles;
}