소스 검색

fixed onWindowResize()

WestLangley 4 년 전
부모
커밋
5a3abfc177
1개의 변경된 파일4개의 추가작업 그리고 7개의 파일을 삭제
  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();