Commit e7bc1d5e authored by Juan Blanco Segleau's avatar Juan Blanco Segleau

Fixed reset view not working after pan

parent ae6894a9
...@@ -81,37 +81,44 @@ Blockscad.Viewer.prototype = { ...@@ -81,37 +81,44 @@ Blockscad.Viewer.prototype = {
var whichView = document.getElementById("viewMenu"); var whichView = document.getElementById("viewMenu");
if (whichView.value == "top") { if (whichView.value == "top") {
this.controls.reset();
this.camera.position.set( 0, 0, 50 ); this.camera.position.set( 0, 0, 50 );
this.camera.lookAt( new THREE.Vector3( 0, 0, 0 ) ); this.camera.lookAt( new THREE.Vector3( 0, 0, 0 ) );
} }
else if (whichView.value == "front") { else if (whichView.value == "front") {
this.controls.reset();
this.camera.position.set( 0, -50, 0 ); this.camera.position.set( 0, -50, 0 );
this.camera.lookAt( new THREE.Vector3( 0, 0, 0 ) ); this.camera.lookAt( new THREE.Vector3( 0, 0, 0 ) );
} }
else if (whichView.value == "left") { else if (whichView.value == "left") {
this.controls.reset();
this.camera.position.set( -50, 0, 0 ); this.camera.position.set( -50, 0, 0 );
this.camera.lookAt( new THREE.Vector3( 0, 0, 0 ) ); this.camera.lookAt( new THREE.Vector3( 0, 0, 0 ) );
} }
else if (whichView.value == "right") { else if (whichView.value == "right") {
this.controls.reset();
this.camera.position.set( 50, 0, 0 ); this.camera.position.set( 50, 0, 0 );
this.camera.lookAt( new THREE.Vector3( 0, 0, 0 ) ); this.camera.lookAt( new THREE.Vector3( 0, 0, 0 ) );
} }
else if (whichView.value == "bottom") { else if (whichView.value == "bottom") {
this.controls.reset();
this.camera.position.set( 0, 0, -50 ); this.camera.position.set( 0, 0, -50 );
this.camera.lookAt( new THREE.Vector3( 0, 0, 0 ) ); this.camera.lookAt( new THREE.Vector3( 0, 0, 0 ) );
} }
else if (whichView.value == "back") { else if (whichView.value == "back") {
this.controls.reset();
this.camera.position.set( 0, 50, 0 ); this.camera.position.set( 0, 50, 0 );
this.camera.lookAt( new THREE.Vector3( 0, 0, 0 ) ); this.camera.lookAt( new THREE.Vector3( 0, 0, 0 ) );
} }
else if (whichView.value == "diagonal") { else if (whichView.value == "diagonal") {
this.controls.reset();
this.camera.position.set( 50, -50, 50 ); this.camera.position.set( 50, -50, 50 );
this.camera.lookAt( new THREE.Vector3( 0, 0, 0 ) ); this.camera.lookAt( new THREE.Vector3( 0, 0, 0 ) );
} }
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment