OrthographicCamera当调整窗口resize时变形的解决方法

修改相机的aspect就好了

       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;

				camera.updateProjectionMatrix();

				renderer.setSize( window.innerWidth, window.innerHeight );

			}

参考这里
https://threejs.org/examples/#webgl_interactive_cubes_ortho

上一篇:python中字符串相关运算


下一篇:React Hooks 实现响应式布局