diff --git a/modules/scene/controls/CADTrackballControls.js b/modules/scene/controls/CADTrackballControls.js index 7a07e9a4..15f45e70 100644 --- a/modules/scene/controls/CADTrackballControls.js +++ b/modules/scene/controls/CADTrackballControls.js @@ -22,6 +22,9 @@ export function CADTrackballControls( object, domElement ) { this.screen = { left: 0, top: 0, width: 0, height: 0 }; + this.rotateSpeed = 1.0; + this.zoomSpeed = 1.2; + this.panSpeed = 0.3; this.noRotate = false; this.noZoom = false; @@ -221,7 +224,7 @@ export function CADTrackballControls( object, domElement ) { } else { - factor = 1.0 + (_zoomEnd.y - _zoomStart.y) * _this.projectionZoomSpeed; + factor = 1.0 + ( _zoomEnd.y - _zoomStart.y ) * _this.zoomSpeed; if ( factor !== 1.0 && factor > 0.0 ) { diff --git a/modules/scene/sceneSetup.ts b/modules/scene/sceneSetup.ts index 453d91dd..636beb98 100644 --- a/modules/scene/sceneSetup.ts +++ b/modules/scene/sceneSetup.ts @@ -161,9 +161,10 @@ export default class SceneSetUp { // controls.update(); // }, false ); - // trackballControls.rotateSpeed = 3.8; - // trackballControls.zoomSpeed = 1.2; - // trackballControls.panSpeed = 0.8; + trackballControls.rotateSpeed = 3.8 * DPR; + trackballControls.projectionZoomSpeed = 0.5 * DPR; + trackballControls.zoomSpeed = 1.2 * DPR; + trackballControls.panSpeed = 0.3 * DPR; trackballControls.noZoom = false; trackballControls.noPan = false; @@ -192,18 +193,6 @@ export default class SceneSetUp { }; this.updateControlsAndHelpers = function() { - if (this.camera.type as any == "OrthographicCamera") { - this.trackballControls.rotateSpeed = 3.8; - this.trackballControls.projectionZoomSpeed = 5; - this.trackballControls.zoomSpeed = 5; - this.trackballControls.panSpeed = .1; - } - if (this.camera.type == "PerspectiveCamera") { - this.trackballControls.rotateSpeed = 3.8; - this.trackballControls.projectionZoomSpeed = 1; - this.trackballControls.zoomSpeed = 1; - this.trackballControls.panSpeed = 1; - } trackballControls.update(); updateTransformControls(); }; @@ -299,7 +288,6 @@ export default class SceneSetUp { }; render() { - this.light.position.set(this.camera.position.x, this.camera.position.y, this.camera.position.z); this.renderer.render(this.scene, this.camera); this.onRendered();