1. 首页
  2. three.js

three.js调整大小时画布变形(即使使用requestAnimationFrame)

three.jsn标题是不言自明的。n每次刷新时宽高比会恢复正常,这不是一个很好的选择。n代码:n让场景、相机、渲染器、立方体;函数=新建三点几何(2,2,2);=5;}函数animate(){requestAnimationFrame(animate);立方体旋转.z+=0.01;立方体旋转.y+=0.01;渲染器.render(场景,>由Mugen87在post#2中解决,它应该是:>孤独的流浪者:n它应该是:n实例:https://jsfiddle.net/w189srhz/2/5n噢,哇,没想到这会是个问题,谢谢n Canvas distortion on resize (even with requestAnimationFrame)n

three.js调整大小时画布变形(即使使用requestAnimationFrame) 为WP2原创文章,链接:https://www.wp2.cn/three-js/three-js%e8%b0%83%e6%95%b4%e5%a4%a7%e5%b0%8f%e6%97%b6%e7%94%bb%e5%b8%83%e5%8f%98%e5%bd%a2%ef%bc%88%e5%8d%b3%e4%bd%bf%e4%bd%bf%e7%94%a8requestanimationframe%ef%bc%89/