diff --git a/README.md b/README.md
index b363fb0..b4af4ee 100644
--- a/README.md
+++ b/README.md
@@ -37,3 +37,9 @@ Click and hold the right mouse button and move it around to move the box around.
Use WASD or cursor keys to move the box around.
Use the mouse wheel to zoom in/out.
+
+## How to scan your box sides
+
+Scan the front and back of the box as if you would scan a letter or document.
+
+Scan the other sides (top, bottom, left and right) while the front of the box is facing towards you while operating the scanner.
diff --git a/bigbox3d.js b/bigbox3d.js
index 0096ef0..83f7d57 100644
--- a/bigbox3d.js
+++ b/bigbox3d.js
@@ -49,16 +49,19 @@ function calculateDimensions() {
console.log('texturen:', texturen);
- // var width_absolute = image_sources[tex_front].width + image_sources[tex_back].width + image_sources[tex_top].width + image_sources[tex_bottom].width;
- const width_absolute = texturen[enmFaces.front].image.width + texturen[enmFaces.back].image.width + texturen[enmFaces.top].image.width + texturen[enmFaces.bottom].image.width;
+ // const width_absolute = image_sources[tex_front].width + image_sources[tex_back].width + image_sources[tex_top].width + image_sources[tex_bottom].width;
+ // const width_absolute = texturen[enmFaces.front].image.width + texturen[enmFaces.back].image.width + texturen[enmFaces.top].image.width + texturen[enmFaces.bottom].image.width;
+ const width_absolute = texturen[enmFaces.front].image.width + texturen[enmFaces.back].image.width + texturen[enmFaces.top].image.height + texturen[enmFaces.bottom].image.height;
const width_mean = width_absolute / 4;
- // var height_absolute = image_sources[tex_front].height + image_sources[tex_back].height + image_sources[tex_left].height + image_sources[tex_right].height;
- const height_absolute = texturen[enmFaces.front].image.height + texturen[enmFaces.back].image.height + texturen[enmFaces.left].image.width + texturen[enmFaces.right].image.width;
+ // const height_absolute = image_sources[tex_front].height + image_sources[tex_back].height + image_sources[tex_left].height + image_sources[tex_right].height;
+ // const height_absolute = texturen[enmFaces.front].image.height + texturen[enmFaces.back].image.height + texturen[enmFaces.left].image.width + texturen[enmFaces.right].image.width;
+ const height_absolute = texturen[enmFaces.front].image.height + texturen[enmFaces.back].image.height + texturen[enmFaces.left].image.height + texturen[enmFaces.right].image.height;
const height_mean = height_absolute / 4;
- // var depth_absolute = image_sources[tex_top].height + image_sources[tex_bottom].height + image_sources[tex_left].width + image_sources[tex_right].width;
- const depth_absolute = texturen[enmFaces.top].image.height + texturen[enmFaces.bottom].image.height + texturen[enmFaces.left].image.height + texturen[enmFaces.right].image.height;
+ // const depth_absolute = image_sources[tex_top].height + image_sources[tex_bottom].height + image_sources[tex_left].width + image_sources[tex_right].width;
+ // const depth_absolute = texturen[enmFaces.top].image.height + texturen[enmFaces.bottom].image.height + texturen[enmFaces.left].image.height + texturen[enmFaces.right].image.height;
+ const depth_absolute = texturen[enmFaces.top].image.width + texturen[enmFaces.bottom].image.width + texturen[enmFaces.left].image.width + texturen[enmFaces.right].image.width;
const depth_mean = depth_absolute / 4;
console.log('width_mean:', width_mean);
@@ -268,28 +271,28 @@ function initBuffers() {
1.0 * dimensions.width, -1.0 * dimensions.height, -1.0 * dimensions.depth,
// Top face
- -1.0 * dimensions.width, 1.0 * dimensions.height, -1.0 * dimensions.depth,
-1.0 * dimensions.width, 1.0 * dimensions.height, 1.0 * dimensions.depth,
1.0 * dimensions.width, 1.0 * dimensions.height, 1.0 * dimensions.depth,
1.0 * dimensions.width, 1.0 * dimensions.height, -1.0 * dimensions.depth,
+ -1.0 * dimensions.width, 1.0 * dimensions.height, -1.0 * dimensions.depth,
// Bottom face
+ -1.0 * dimensions.width, -1.0 * dimensions.height, 1.0 * dimensions.depth,
-1.0 * dimensions.width, -1.0 * dimensions.height, -1.0 * dimensions.depth,
1.0 * dimensions.width, -1.0 * dimensions.height, -1.0 * dimensions.depth,
1.0 * dimensions.width, -1.0 * dimensions.height, 1.0 * dimensions.depth,
- -1.0 * dimensions.width, -1.0 * dimensions.height, 1.0 * dimensions.depth,
// Right face
- 1.0 * dimensions.width, -1.0 * dimensions.height, -1.0 * dimensions.depth,
1.0 * dimensions.width, 1.0 * dimensions.height, -1.0 * dimensions.depth,
1.0 * dimensions.width, 1.0 * dimensions.height, 1.0 * dimensions.depth,
1.0 * dimensions.width, -1.0 * dimensions.height, 1.0 * dimensions.depth,
+ 1.0 * dimensions.width, -1.0 * dimensions.height, -1.0 * dimensions.depth,
// Left face
+ -1.0 * dimensions.width, 1.0 * dimensions.height, -1.0 * dimensions.depth,
-1.0 * dimensions.width, -1.0 * dimensions.height, -1.0 * dimensions.depth,
-1.0 * dimensions.width, -1.0 * dimensions.height, 1.0 * dimensions.depth,
-1.0 * dimensions.width, 1.0 * dimensions.height, 1.0 * dimensions.depth,
- -1.0 * dimensions.width, 1.0 * dimensions.height, -1.0 * dimensions.depth,
];
gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vertices), gl.STATIC_DRAW);
diff --git a/template-back.jpg b/template-back.jpg
index 4a36dcf..64c61c7 100644
Binary files a/template-back.jpg and b/template-back.jpg differ
diff --git a/template-bottom.jpg b/template-bottom.jpg
index 1ce8bb3..d6bc2e4 100644
Binary files a/template-bottom.jpg and b/template-bottom.jpg differ
diff --git a/template-front.jpg b/template-front.jpg
index 85f3bf0..71f4c50 100644
Binary files a/template-front.jpg and b/template-front.jpg differ
diff --git a/template-left.jpg b/template-left.jpg
index 61def97..2734166 100644
Binary files a/template-left.jpg and b/template-left.jpg differ
diff --git a/template-right.jpg b/template-right.jpg
index a6f79f8..ad919be 100644
Binary files a/template-right.jpg and b/template-right.jpg differ
diff --git a/template-top.jpg b/template-top.jpg
index 6cba0a4..6631fa1 100644
Binary files a/template-top.jpg and b/template-top.jpg differ