Explorar o código

fixed onWindowResize()

WestLangley %!s(int64=4) %!d(string=hai) anos
pai
achega
5a3abfc177
Modificáronse 1 ficheiros con 4 adicións e 7 borrados
  1. 4 7
      examples/webgl_furnace_test.html

+ 4 - 7
examples/webgl_furnace_test.html

@@ -129,16 +129,13 @@
 
 			function onWindowResize() {
 
-				const aspect = window.innerWidth / window.innerHeight;
-
-				camera.left = - frustumSize * aspect / 2;
-				camera.right = frustumSize * aspect / 2;
-				camera.top = frustumSize / 2;
-				camera.bottom = - frustumSize / 2;
+				const width = window.innerWidth;
+				const height = window.innerHeight;
 
+				camera.aspect = width / height;
 				camera.updateProjectionMatrix();
 
-				renderer.setSize( window.innerWidth, window.innerHeight );
+				renderer.setSize( width, height );
 
 				render();