Jelajahi Sumber

WebGL Fat Lines Example: Enable Damping (#26981)

WestLangley 1 tahun lalu
induk
melakukan
f6ca510cc7
1 mengubah file dengan 3 tambahan dan 0 penghapusan
  1. 3 0
      examples/webgl_lines_fat.html

+ 3 - 0
examples/webgl_lines_fat.html

@@ -66,6 +66,7 @@
 				camera2.position.copy( camera.position );
 
 				controls = new OrbitControls( camera, renderer.domElement );
+				controls.enableDamping = true;
 				controls.minDistance = 10;
 				controls.maxDistance = 500;
 
@@ -176,6 +177,8 @@
 
 				renderer.setViewport( 0, 0, window.innerWidth, window.innerHeight );
 
+				controls.update();
+
 				// renderer will set this eventually
 				matLine.resolution.set( window.innerWidth, window.innerHeight ); // resolution of the viewport