diff options
-rw-r--r-- | DisplayClass.cpp | 28 | ||||
-rw-r--r-- | 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<Triangle> triangles = cubehole.getTriangles(); - + std::list<Triangle> triangles = cubehole0.getTriangles(); + std::list<Triangle> t1 = cubehole1.getTriangles(); + triangles.splice(triangles.end(), t1); + std::list<Triangle> 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_*/ |