Skip to content

Commit 39df6d2

Browse files
committed
Enabled damping
1 parent 7c6b671 commit 39df6d2

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

examples/webgl_panorama_cube.html

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,10 @@
6060
camera = new THREE.PerspectiveCamera( 90, window.innerWidth / window.innerHeight, 0.1, 100 );
6161
camera.position.z = 0.01;
6262

63-
controls = new THREE.OrbitControls( camera );
63+
controls = new THREE.OrbitControls( camera, renderer.domElement );
6464
controls.enableZoom = false;
6565
controls.enablePan = false;
66+
controls.enableDamping = true;
6667

6768
var textures = getTexturesFromAtlasFile( "textures/cube/sun_temple_stripe.jpg", 6 );
6869

@@ -130,10 +131,12 @@
130131

131132
function animate() {
132133

133-
renderer.render( scene, camera );
134-
135134
requestAnimationFrame( animate );
136135

136+
controls.update(); // required when damping is enabled
137+
138+
renderer.render( scene, camera );
139+
137140
}
138141

139142
</script>

0 commit comments

Comments
 (0)