summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorConstantin Riß <constantin.riss@dre.de>2009-12-10 22:13:21 +0100
committerConstantin Riß <constantin.riss@dre.de>2009-12-10 22:13:21 +0100
commit7b95a7d4bf899b4e87509ded6bf9633b944febaf (patch)
tree774529c58c79712c41149987e3b6fa89405210f8
parentcb23d219b3b96aa07ac7ed03d7dfdb316c5f9b9b (diff)
downloadc3d-7b95a7d4bf899b4e87509ded6bf9633b944febaf.tar
c3d-7b95a7d4bf899b4e87509ded6bf9633b944febaf.zip
Cubehole wird richtig angezeigt.
-rw-r--r--Cubehole.h12
-rw-r--r--Trapezocube.cpp1
2 files changed, 7 insertions, 6 deletions
diff --git a/Cubehole.h b/Cubehole.h
index 3398ef4..835aa62 100644
--- a/Cubehole.h
+++ b/Cubehole.h
@@ -40,18 +40,18 @@ class Cubehole
innerwidth = iw;
innerdepth = id;
front.setSize(width, innerwidth, height, (depth-innerdepth)/2);
- right.setSize(depth, innerdepth, height, (width-innerwidth)/2);
+ right.setSize(innerdepth, depth, height, (width-innerwidth)/2);
back.setSize(width, innerwidth, height, (depth-innerdepth)/2);
- left.setSize(depth, innerdepth, height, (width-innerwidth)/2);
+ left.setSize(innerdepth, depth, height, (width-innerwidth)/2);
}
void setPos(float x0, float y0, float z0) {
x = x0;
y = y0;
z = z0;
- front.setPos(x, y, z/*(depth-(depth-innerdepth)/2*/);
- right.setPos(x-(width-innerwidth)/2, y, z/*width-(width-innerwidth)/2*/);
- back.setPos(x, y, z/*depth-(depth-innerdepth)/2*/);
- left.setPos(x-(width-innerwidth)/2, y, z/*width-(width-innerwidth)/2*/);
+ front.setPos(x, y, z+(depth/2-(depth-innerdepth)/4));
+ right.setPos(x, y, z-(width/2-(width-innerwidth)/4));
+ back.setPos(x, y, z+(depth/2-(depth-innerdepth)/4));
+ left.setPos(x, y, z-(width/2-(width-innerwidth)/4));
}
void setColor(const vmml::vec4f &cf, const vmml::vec4f &cr, const vmml::vec4f &cb, const vmml::vec4f &cl) {
front.setColor(cf);
diff --git a/Trapezocube.cpp b/Trapezocube.cpp
index 0412413..5825efc 100644
--- a/Trapezocube.cpp
+++ b/Trapezocube.cpp
@@ -16,6 +16,7 @@ std::list<Triangle> Trapezocube::getTriangles()
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), color));
+
// Back face
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),