Explorar o código

Examples: Clean up. (#27975)

* Examples: Cleanup

* Update webgpu_mesh_batch.html
Nathan Bierema hai 1 ano
pai
achega
85e39c0b20
Modificáronse 1 ficheiros con 6 adicións e 11 borrados
  1. 6 11
      examples/webgpu_mesh_batch.html

+ 6 - 11
examples/webgpu_mesh_batch.html

@@ -256,7 +256,7 @@
 			// gui
 
 			gui = new GUI();
-			gui.add( api, 'webgpu', true ).onChange( () => {
+			gui.add( api, 'webgpu' ).onChange( () => {
 
 				init( ! api.webgpu );
 
@@ -296,19 +296,14 @@
 
 			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();
 
+				renderer.setSize( width, height );
+
 			}