From eea697e0cb3120ea07fc123460b02f5d9403bb33 Mon Sep 17 00:00:00 2001
From: amira <amiraa@mit.edu>
Date: Thu, 20 Jul 2023 17:02:02 -0400
Subject: [PATCH] simulation better

---
 .../physical_computing_interface/css/style.css  |  5 ++++-
 .../simulation/visualization/main.js            | 17 +++++++++--------
 2 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/01_Code/physical_computing_interface/css/style.css b/01_Code/physical_computing_interface/css/style.css
index e58aec1..d0aef40 100644
--- a/01_Code/physical_computing_interface/css/style.css
+++ b/01_Code/physical_computing_interface/css/style.css
@@ -90,9 +90,10 @@ body,html{width:100%;height:100%;padding:0;margin:0;}
     float: left;
     position: absolute;
     top:50%;
+    height: 49%;
     bottom: var(--bottom);
     /* overflow-y: hidden; */
-    overflow: scroll;
+    /* overflow: scroll; */
     font-family: var(--font);
     color: var(--color2);
     /* z-index: -1; */
@@ -102,6 +103,7 @@ body,html{width:100%;height:100%;padding:0;margin:0;}
     top:var(--top);
     bottom: var(--bottom);
     overflow-y: hidden;
+    overflow-x: hidden;
     font-family: var(--font);
     color: var(--color2);
 }
@@ -110,6 +112,7 @@ body,html{width:100%;height:100%;padding:0;margin:0;}
     top:var(--top);
     bottom: var(--bottom);
     overflow-y: hidden;
+    overflow-x: hidden;
     font-family: var(--font);
     color: var(--color1);
 }
diff --git a/01_Code/physical_computing_interface/simulation/visualization/main.js b/01_Code/physical_computing_interface/simulation/visualization/main.js
index 89e467b..7c95d1d 100644
--- a/01_Code/physical_computing_interface/simulation/visualization/main.js
+++ b/01_Code/physical_computing_interface/simulation/visualization/main.js
@@ -101,16 +101,17 @@ threejs1.prototype.init=function() {
 	this.scene = new THREE.Scene();
 
 	camera = new THREE.PerspectiveCamera( 60, this.getWidth() / this.getHeight(), 1, 10000 );
-	camera = new THREE.PerspectiveCamera( 45, this.getWidth()/ this.getHeight()  , 1, 10000);
+	camera = new THREE.PerspectiveCamera( 45, this.getWidth()/ this.getHeight()  , 1, 10000*GLOBALS.voxelSpacing);
 	// camera.position.set( -gridSize*voxelSize*1.0, 0, 60 );
 	// camera.position.set(  40, 0, 60 );
 	// camera = new THREE.PerspectiveCamera( 45, this.getWidth()/ this.getHeight()  , 1, 10000);
-    camera.position.set( -this.setup.gridSize*voxelSize/2, this.setup.gridSize*voxelSize, this.setup.gridSize*voxelSize/2 );
-    // camera.lookAt(this.setup. gridSize/2*voxelSize, 0, this.setup.gridSize/2*voxelSize );
+    
+	camera.position.set( -this.setup.gridSize*voxelSize/2, this.setup.gridSize*voxelSize, this.setup.gridSize*voxelSize/2 );
+    // camera.lookAt(this.setup.gridSize/2*voxelSize, 0, this.setup.gridSize/2*voxelSize );
 
 	this.controls = new THREE.OrbitControls( camera, this.renderer.domElement );
-	this.controls.minDistance = 10;
-	this.controls.maxDistance = 500;
+	// this.controls.minDistance = 10;
+	// this.controls.maxDistance = 500;
 	this.controls.target= new THREE.Vector3(this.setup.gridSize/2*voxelSize, 0, this.setup.gridSize/2*voxelSize);
 	this.controls.autoRotate=true;
 	this.controls.update();
@@ -183,7 +184,7 @@ threejs1.prototype.init=function() {
     // guiCreate(this);
 
 	// this.container.addEventListener( 'mousemove', onDocumentMouseMoveThree, false );
-    this.container.addEventListener( 'mousedown', onDocumentMouseDown1, false );
+    // this.container.addEventListener( 'mousedown', onDocumentMouseDown1, false );
     
 
 	window.addEventListener( 'mouseup', onWindowResize1, false );
@@ -585,8 +586,8 @@ threejs1.prototype.getWidth=function(){
 
 threejs1.prototype.getHeight=function(){
     // return container.style.height;
-	this.windowHeight=window.innerHeight-$('#'+three.container1Name).height()
-	return window.innerHeight-$('#'+three.container1Name).height()
+	this.windowHeight=window.innerHeight-$('#'+three.container1Name).height()-20
+	return window.innerHeight-$('#'+three.container1Name).height()-20
 	if(this.container1Name===""){
 		console.log()
 		return window.innerHeight ;
-- 
GitLab