summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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),