summaryrefslogtreecommitdiffstats
path: root/Trapezocube.cpp
diff options
context:
space:
mode:
authorConstantin Riß <constantin.riss@dre.de>2009-12-10 22:00:10 +0100
committerConstantin Riß <constantin.riss@dre.de>2009-12-10 22:00:10 +0100
commitfbed33283cdd85589e4ea577ba11e635f55723f0 (patch)
tree6f4c97fbead4bdd566d10c7284a0e2605571def5 /Trapezocube.cpp
parent327f92f8d668da57febe51b84e52667c241d4ba4 (diff)
downloadc3d-fbed33283cdd85589e4ea577ba11e635f55723f0.tar
c3d-fbed33283cdd85589e4ea577ba11e635f55723f0.zip
Kleine änderungen.
Diffstat (limited to 'Trapezocube.cpp')
-rw-r--r--Trapezocube.cpp40
1 files changed, 14 insertions, 26 deletions
diff --git a/Trapezocube.cpp b/Trapezocube.cpp
index 8205ee6..85570c3 100644
--- a/Trapezocube.cpp
+++ b/Trapezocube.cpp
@@ -1,6 +1,5 @@
#include "Trapezocube.h"
-
std::list<Triangle> Trapezocube::getTriangles()
{
std::list<Triangle> triangles;
@@ -10,68 +9,58 @@ std::list<Triangle> Trapezocube::getTriangles()
rotation.rotate_y(M_PI*rotate/180.0f);
// Front face
- vmml::vec4f c(0.0, 0.0, 1.0, 0.5);
-
triangles.push_back(Triangle(vmml::vec3f(x-widthfront/2, y+height/2, z+depth/2),
vmml::vec3f(x-widthfront/2, y-height/2, z+depth/2),
- vmml::vec3f(x+widthfront/2, y+height/2, z+depth/2), c));
+ vmml::vec3f(x+widthfront/2, y+height/2, z+depth/2), color));
triangles.push_back(Triangle(vmml::vec3f(x-widthfront/2, y-height/2, z+depth/2),
vmml::vec3f(x+widthfront/2, y-height/2, z+depth/2),
- vmml::vec3f(x+widthfront/2, y+height/2, z+depth/2), c));
-
+ vmml::vec3f(x+widthfront/2, y+height/2, z+depth/2), color));
// Back face
- c = vmml::vec4f(1.0, 1.0, 0.0, 0.5);
-
- triangles.push_back(Triangle(vmml::vec3f(x-widthback/2, y+height/2, z-depth/2),
+ (trianglultisample) {
+ glClearColor(0.0, );//glClearColor(1.0, 0.85, 0.es.push_back(Triangle(vmml::vec3f(x-widthback/2, y+height/2, z-depth/2),
vmml::vec3f(x+widthback/2, y+height/2, z-depth/2),
- vmml::vec3f(x-widthback/2, y-height/2, z-depth/2), c));
+ vmml::vec3f(x-widthback/2, y-height/2, z-depth/2), color));
triangles.push_back(Triangle(vmml::vec3f(x-widthback/2, y-height/2, z-depth/2),
vmml::vec3f(x+widthback/2, y+height/2, z-depth/2),
- vmml::vec3f(x+widthback/2, y-height/2, z-depth/2), c));
+ vmml::vec3f(x+widthback/2, y-height/2, z-depth/2), color));
// Left face
- c = vmml::vec4f(0.0, 1.0, 0.0, 0.5);
-
triangles.push_back(Triangle(vmml::vec3f(x-widthfront/2, y+height/2, z+depth/2),
vmml::vec3f(x-widthback /2, y+height/2, z-depth/2),
- vmml::vec3f(x-widthfront/2, y-height/2, z+depth/2), c));
+ vmml::vec3f(x-widthfront/2, y-height/2, z+depth/2), color));
triangles.push_back(Triangle(vmml::vec3f(x-widthback /2, y-height/2, z-depth/2),
vmml::vec3f(x-widthfront/2, y-height/2, z+depth/2),
- vmml::vec3f(x-widthback /2, y+height/2, z-depth/2), c));
+ vmml::vec3f(x-widthback /2, y+height/2, z-depth/2), color));
// Right face
-
triangles.push_back(Triangle(vmml::vec3f(x+widthfront/2, y+height/2, z+depth/2),
vmml::vec3f(x+widthfront/2, y-height/2, z+depth/2),
- vmml::vec3f(x+widthback /2, y+height/2, z-depth/2), c));
+ vmml::vec3f(x+widthback /2, y+height/2, z-depth/2), color));
triangles.push_back(Triangle(vmml::vec3f(x+widthback /2, y-height/2, z-depth/2),
vmml::vec3f(x+widthback /2, y+height/2, z-depth/2),
- vmml::vec3f(x+widthfront/2, y-height/2, z+depth/2), c));
+ vmml::vec3f(x+widthfront/2, y-height/2, z+depth/2), color));
// Top face
- c = vmml::vec4f(1.0, 0.0, 0.0, 0.5);
-
triangles.push_back(Triangle(vmml::vec3f(x-widthfront/2, y+height/2, z+depth/2),
vmml::vec3f(x+widthfront/2, y+height/2, z+depth/2),
- vmml::vec3f(x-widthback /2, y+height/2, z-depth/2), c));
+ vmml::vec3f(x-widthback /2, y+height/2, z-depth/2), color));
triangles.push_back(Triangle(vmml::vec3f(x+widthfront/2, y+height/2, z+depth/2),
vmml::vec3f(x+widthback /2, y+height/2, z-depth/2),
- vmml::vec3f(x-widthback /2, y+height/2, z-depth/2), c));
+ vmml::vec3f(x-widthback /2, y+height/2, z-depth/2), color));
// Bottom face
-
triangles.push_back(Triangle(vmml::vec3f(x-widthfront/2, y-height/2, z+depth/2),
vmml::vec3f(x-widthback /2, y-height/2, z-depth/2),
- vmml::vec3f(x+widthfront/2, y-height/2, z+depth/2), c));
+ vmml::vec3f(x+widthfront/2, y-height/2, z+depth/2), color));
triangles.push_back(Triangle(vmml::vec3f(x+widthfront/2, y-height/2, z+depth/2),
vmml::vec3f(x-widthback /2, y-height/2, z-depth/2),
- vmml::vec3f(x+widthback /2, y-height/2, z-depth/2), c));
+ vmml::vec3f(x+widthback /2, y-height/2, z-depth/2), color));
for(std::list<Triangle>::iterator t = triangles.begin(); t != triangles.end(); ++t) {
t->transform(rotation);
@@ -79,4 +68,3 @@ std::list<Triangle> Trapezocube::getTriangles()
return triangles;
}
-