Просмотр исходного кода

fix volume render example aspect

Almar Klein 7 лет назад
Родитель
Сommit
aea5f5ae38
1 измененных файлов с 4 добавлено и 1 удалено
  1. 4 1
      examples/webgl_materials_texture3d_volume1.html

+ 4 - 1
examples/webgl_materials_texture3d_volume1.html

@@ -213,7 +213,10 @@
 
 		function onWindowResize() {
 
-			camera.aspect = window.innerWidth / window.innerHeight;
+			this.camera.right = window.innerWidth / 5.0;
+			this.camera.left = -this.camera.right;
+			this.camera.top = window.innerHeight / 5.0;
+			this.camera.bottom = -this.camera.top;
 			camera.updateProjectionMatrix();
 
 			renderer.setSize( window.innerWidth, window.innerHeight );

粤ICP备19079148号