adjust zoom speed

This commit is contained in:
Val Erastov 2022-04-04 22:14:00 -07:00
parent 79a77dda38
commit 99802d66f4
2 changed files with 8 additions and 17 deletions

View file

@ -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 ) {

View file

@ -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();