diff options
author | Matthias Schiffer <matthias@gamezock.de> | 2009-12-10 11:29:16 +0100 |
---|---|---|
committer | Matthias Schiffer <matthias@gamezock.de> | 2009-12-10 11:29:16 +0100 |
commit | f31beab9a7160e913da7ff30d946eaf2a721fdc8 (patch) | |
tree | 1239a46bbea9c8f4af295d2a66e0429d960550ff /Cuboid.cpp | |
parent | 4f2236f36446a5b097e28c0f76e4962ce7e115b1 (diff) | |
download | c3d-f31beab9a7160e913da7ff30d946eaf2a721fdc8.tar c3d-f31beab9a7160e913da7ff30d946eaf2a721fdc8.zip |
BSPTree-Visiting-Reihenfolge korrigiert
Diffstat (limited to 'Cuboid.cpp')
-rw-r--r-- | Cuboid.cpp | 32 |
1 files changed, 14 insertions, 18 deletions
@@ -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; } |