Преглед изворни кода

Examples: Clean up. (#27975)

* Examples: Cleanup

* Update webgpu_mesh_batch.html
Nathan Bierema пре 1 година
родитељ
комит
85e39c0b20
1 измењених фајлова са 6 додато и 11 уклоњено
  1. 6 11
      examples/webgpu_mesh_batch.html

+ 6 - 11
examples/webgpu_mesh_batch.html

@@ -256,7 +256,7 @@
 			// gui
 			// gui
 
 
 			gui = new GUI();
 			gui = new GUI();
-			gui.add( api, 'webgpu', true ).onChange( () => {
+			gui.add( api, 'webgpu' ).onChange( () => {
 
 
 				init( ! api.webgpu );
 				init( ! api.webgpu );
 
 
@@ -296,19 +296,14 @@
 
 
 			function onWindowResize() {
 			function onWindowResize() {
 
 
-				renderer.setSize( window.innerWidth, window.innerHeight );
-
-				const aspect = window.innerWidth / window.innerHeight;
-
-				camera.aspect = aspect;
-
-				const frustumHeight = camera.top - camera.bottom;
-
-				camera.left = - frustumHeight * aspect / 2;
-				camera.right = frustumHeight * aspect / 2;
+				const width = window.innerWidth;
+				const height = window.innerHeight;
 
 
+				camera.aspect = width / height;
 				camera.updateProjectionMatrix();
 				camera.updateProjectionMatrix();
 
 
+				renderer.setSize( width, height );
+
 			}
 			}