summaryrefslogtreecommitdiffstats
path: root/Cuboid.cpp
diff options
context:
space:
mode:
authorMatthias Schiffer <matthias@gamezock.de>2009-12-10 11:29:16 +0100
committerMatthias Schiffer <matthias@gamezock.de>2009-12-10 11:29:16 +0100
commitf31beab9a7160e913da7ff30d946eaf2a721fdc8 (patch)
tree1239a46bbea9c8f4af295d2a66e0429d960550ff /Cuboid.cpp
parent4f2236f36446a5b097e28c0f76e4962ce7e115b1 (diff)
downloadc3d-f31beab9a7160e913da7ff30d946eaf2a721fdc8.tar
c3d-f31beab9a7160e913da7ff30d946eaf2a721fdc8.zip
BSPTree-Visiting-Reihenfolge korrigiert
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;
}