提交 a1285b36 编写于 作者: W WestLangley

Limit zooming

上级 b3444502
...@@ -164,7 +164,10 @@ ...@@ -164,7 +164,10 @@
function onDocumentMouseWheel( event ) { function onDocumentMouseWheel( event ) {
camera.fov += event.deltaY * 0.05; var fov = camera.fov + event.deltaY * 0.05;
camera.fov = THREE.Math.clamp( fov, 10, 75 );
camera.updateProjectionMatrix(); camera.updateProjectionMatrix();
} }
......
...@@ -172,7 +172,10 @@ ...@@ -172,7 +172,10 @@
function onDocumentMouseWheel( event ) { function onDocumentMouseWheel( event ) {
camera.fov += event.deltaY * 0.05; var fov = camera.fov + event.deltaY * 0.05;
camera.fov = THREE.Math.clamp( fov, 10, 75 );
camera.updateProjectionMatrix(); camera.updateProjectionMatrix();
} }
......
...@@ -156,7 +156,10 @@ ...@@ -156,7 +156,10 @@
function onDocumentMouseWheel( event ) { function onDocumentMouseWheel( event ) {
camera.fov += event.deltaY * 0.05; var fov = camera.fov + event.deltaY * 0.05;
camera.fov = THREE.Math.clamp( fov, 10, 75 );
camera.updateProjectionMatrix(); camera.updateProjectionMatrix();
} }
......
...@@ -142,7 +142,10 @@ ...@@ -142,7 +142,10 @@
function onDocumentMouseWheel( event ) { function onDocumentMouseWheel( event ) {
camera.fov += ( event.deltaY * 0.05 ); var fov = camera.fov + event.deltaY * 0.05;
camera.fov = THREE.Math.clamp( fov, 10, 75 );
camera.updateProjectionMatrix(); camera.updateProjectionMatrix();
} }
......
...@@ -98,7 +98,7 @@ ...@@ -98,7 +98,7 @@
var texture = new THREE.TextureLoader().load( 'textures/ricoh_theta_s.jpg' ); var texture = new THREE.TextureLoader().load( 'textures/ricoh_theta_s.jpg' );
texture.format = THREE.RGBFormat; texture.format = THREE.RGBFormat;
var material = new THREE.MeshBasicMaterial( { map: texture } ); var material = new THREE.MeshBasicMaterial( { map: texture } );
mesh = new THREE.Mesh( geometry, material ); mesh = new THREE.Mesh( geometry, material );
scene.add( mesh ); scene.add( mesh );
...@@ -163,6 +163,8 @@ ...@@ -163,6 +163,8 @@
distance += event.deltaY * 0.05; distance += event.deltaY * 0.05;
distance = THREE.Math.clamp( distance, 400, 1000 );
} }
function animate() { function animate() {
......
...@@ -169,7 +169,10 @@ ...@@ -169,7 +169,10 @@
function onDocumentMouseWheel( event ) { function onDocumentMouseWheel( event ) {
camera.fov += event.deltaY * 0.05; var fov = camera.fov + event.deltaY * 0.05;
camera.fov = THREE.Math.clamp( fov, 10, 75 );
camera.updateProjectionMatrix(); camera.updateProjectionMatrix();
} }
......
...@@ -146,6 +146,8 @@ ...@@ -146,6 +146,8 @@
distance += event.deltaY * 0.05; distance += event.deltaY * 0.05;
distance = THREE.Math.clamp( distance, 400, 500 );
} }
function animate() { function animate() {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册