Browse Source

Fixed ortho interactive example window resize.

Mr.doob 10 năm trước cách đây
mục cha
commit
1f8b7176e1
1 tập tin đã thay đổi với 5 bổ sung1 xóa
  1. 5 1
      examples/webgl_interactive_cubes_ortho.html

+ 5 - 1
examples/webgl_interactive_cubes_ortho.html

@@ -96,7 +96,11 @@
 
 			function onWindowResize() {
 
-				camera.aspect = window.innerWidth / window.innerHeight;
+				camera.left = window.innerWidth / - 2;
+				camera.right = window.innerWidth / 2;
+				camera.top = window.innerHeight / 2;
+				camera.bottom = window.innerHeight / - 2;
+
 				camera.updateProjectionMatrix();
 
 				renderer.setSize( window.innerWidth, window.innerHeight );