Browse Source

Examples: Clean up. (#29422)

* Examples: Clean up.

* Example: Clean up.

* Examples: Simplify frustum setup.
Michael Herzog 1 tuần trước cách đây
mục cha
commit
f048cd92b5
1 tập tin đã thay đổi với 7 bổ sung1 xóa
  1. 7 1
      examples/misc_exporter_gltf.html

+ 7 - 1
examples/misc_exporter_gltf.html

@@ -368,7 +368,13 @@
 				// ---------------------------------------------------------------------
 				// Ortho camera
 				// ---------------------------------------------------------------------
-				const cameraOrtho = new THREE.OrthographicCamera( window.innerWidth / - 2, window.innerWidth / 2, window.innerHeight / 2, window.innerHeight / - 2, 0.1, 10 );
+
+				const height = 1000; // frustum height
+				const aspect = window.innerWidth / window.innerHeight;
+
+				const cameraOrtho = new THREE.OrthographicCamera( - height * aspect, height * aspect, height, - height, 0, 2000 );
+				cameraOrtho.position.set( 600, 400, 0 );
+				cameraOrtho.lookAt( 0, 0, 0 );
 				scene1.add( cameraOrtho );
 				cameraOrtho.name = 'OrthographicCamera';