From fbed33283cdd85589e4ea577ba11e635f55723f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Constantin=20Ri=C3=9F?= Date: Thu, 10 Dec 2009 22:00:10 +0100 Subject: =?UTF-8?q?Kleine=20=C3=A4nderungen.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Trapezocube.cpp | 40 ++++++++++++++-------------------------- 1 file changed, 14 insertions(+), 26 deletions(-) (limited to 'Trapezocube.cpp') 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 Trapezocube::getTriangles() { std::list triangles; @@ -10,68 +9,58 @@ std::list 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::iterator t = triangles.begin(); t != triangles.end(); ++t) { t->transform(rotation); @@ -79,4 +68,3 @@ std::list Trapezocube::getTriangles() return triangles; } - -- cgit v1.2.3