From 2b8bc4d3b606a1cfe77e3bfe374f6d395556e402 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Constantin=20Ri=C3=9F?= Date: Thu, 10 Dec 2009 22:40:45 +0100 Subject: =?UTF-8?q?Kleine=20=C3=84nderung=20in=20den=20ausgegebenen=20Obje?= =?UTF-8?q?kten.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DisplayClass.cpp | 28 +++++++++++++++++++++------- DisplayClass.h | 2 +- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/DisplayClass.cpp b/DisplayClass.cpp index c621965..b278812 100644 --- a/DisplayClass.cpp +++ b/DisplayClass.cpp @@ -6,11 +6,21 @@ DisplayClass::Renderer DisplayClass::renderer; DisplayClass::DisplayClass() { - cubehole = Cubehole(3.0, 1.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.5, - vmml::vec4f(1.0, 0.0, 0.0, 0.5), - vmml::vec4f(0.0, 1.0, 0.0, 0.5), - vmml::vec4f(0.0, 0.0, 1.0, 0.5), + cubehole0 = Cubehole(3.0, 6.0, 3.0, 0.0, 0.0, 0.0, 2.0, 2.0, + vmml::vec4f(1.0, 0.85, 0.06, 0.5), + vmml::vec4f(1.0, 0.85, 0.06, 0.5), + vmml::vec4f(1.0, 0.85, 0.06, 0.5), vmml::vec4f(1.0, 0.85, 0.06, 0.5)); + cubehole1 = Cubehole(2.0, 6.0, 2.0, 0.0, 0.0, 0.0, 1.0, 1.0, + vmml::vec4f(0.0, 0.85, 0.06, 0.5), + vmml::vec4f(0.0, 0.85, 0.06, 0.5), + vmml::vec4f(0.0, 0.85, 0.06, 0.5), + vmml::vec4f(0.0, 0.85, 0.06, 0.5)); + cubehole2 = Cubehole(1.0, 6.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, + vmml::vec4f(1.0, 0.0, 0.06, 0.5), + vmml::vec4f(1.0, 0.0, 0.06, 0.5), + vmml::vec4f(1.0, 0.0, 0.06, 0.5), + vmml::vec4f(1.0, 0.0, 0.06, 0.5)); } void DisplayClass::renderScene(unsigned long delta) @@ -23,15 +33,19 @@ void DisplayClass::renderScene(unsigned long delta) glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glLoadIdentity(); // Clean up matrix - glTranslatef(0.0, 0.0, -10.0); // Then set up transformation + glTranslatef(0.0, 0.0, -15.0); // Then set up transformation glRotatef(angle, 0.0, 1.0, 0.0); glRotatef(angle*2, 1.0, 0.0, 0.0); glRotatef(angle*3, 0.0, 0.0, 1.0); glRotatef(-angle*5, 1.0, 1.0, 1.0); - std::list triangles = cubehole.getTriangles(); - + std::list triangles = cubehole0.getTriangles(); + std::list t1 = cubehole1.getTriangles(); + triangles.splice(triangles.end(), t1); + std::list t2 = cubehole2.getTriangles(); + triangles.splice(triangles.end(), t2); + BSPTree tree(triangles); vmml::mat4f transform, inverseTransform; diff --git a/DisplayClass.h b/DisplayClass.h index 04ff651..2a28681 100644 --- a/DisplayClass.h +++ b/DisplayClass.h @@ -19,7 +19,7 @@ class DisplayClass static Renderer renderer; - Cubehole cubehole; + Cubehole cubehole0, cubehole1, cubehole2; }; #endif /*_DISPLAYCLASS_H_*/ -- cgit v1.2.3