From 9874bcbdec583ad5f5c615b072d6aede02387be5 Mon Sep 17 00:00:00 2001
From: Amanda Ghassaei <amandaghassaei@gmail.com>
Date: Sun, 25 Jan 2015 15:58:14 -0500
Subject: [PATCH] able to drop voxels in place

---
 js/fea/dmaCell.js       | 4 ++--
 js/models/threeModel.js | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/js/fea/dmaCell.js b/js/fea/dmaCell.js
index 715029db..02686857 100644
--- a/js/fea/dmaCell.js
+++ b/js/fea/dmaCell.js
@@ -7,7 +7,7 @@
 
 (function () {
 
-    var octHeight = 3*30/8*Math.sqrt(5);
+    var octHeight = 3*30/8*Math.sqrt(5);//this isn't quite right
 
     var cellGeometry1 = new THREE.OctahedronGeometry(30/Math.sqrt(2));
     cellGeometry1.applyMatrix(new THREE.Matrix4().makeRotationZ(-3*Math.PI/12));
@@ -23,7 +23,7 @@
 
     function Cell(position) {
 
-        if ((position.z/octHeight)%2==0){
+        if (Math.round(position.z/octHeight)%2==0){
             this.mesh = THREE.SceneUtils.createMultiMaterialObject(cellGeometry1, cellMaterials);
         } else {
             this.mesh = THREE.SceneUtils.createMultiMaterialObject(cellGeometry2, cellMaterials);
diff --git a/js/models/threeModel.js b/js/models/threeModel.js
index 06c4b376..393f7e20 100644
--- a/js/models/threeModel.js
+++ b/js/models/threeModel.js
@@ -5,7 +5,7 @@
 
 function ThreeModel(){
 
-    var camera = new THREE.PerspectiveCamera(60, window.innerWidth/window.innerHeight, 1, 2000);
+    var camera = new THREE.PerspectiveCamera(60, window.innerWidth/window.innerHeight, 1, 4000);
     var scene = new THREE.Scene();
     var renderer = new THREE.WebGLRenderer({antialias:false});
     var objects = [];
-- 
GitLab