summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorConstantin Riß <constantin.riss@dre.de>2009-12-10 22:40:45 +0100
committerConstantin Riß <constantin.riss@dre.de>2009-12-10 22:40:45 +0100
commit2b8bc4d3b606a1cfe77e3bfe374f6d395556e402 (patch)
tree790f9045b4e5ec342617ae8af063f55bb3915a25
parent77bb8d19a7e541946aa29ab8ef4438890a86f00c (diff)
downloadc3d-2b8bc4d3b606a1cfe77e3bfe374f6d395556e402.tar
c3d-2b8bc4d3b606a1cfe77e3bfe374f6d395556e402.zip
Kleine Änderung in den ausgegebenen Objekten.
-rw-r--r--DisplayClass.cpp28
-rw-r--r--DisplayClass.h2
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_*/