three.js 检测模型发生了平移旋转或者缩放?

three.js 里有没有api能够自动检测到图形图像发生了平移旋转或者缩放?


function animate() {
            requestAnimationFrame(animate); 
            render(scene, camera);
        }

        function render(scene, camera){
            scene.traverse(function(object) {
                         scene = setLODDistance(scene, thresHold);
                });
            renderer.render(scene, camera);
        }

    animate();

上述函数每一帧都会遍历一次scene.traverse函数。
我需要做优化:检测只有发生了改变,才调用setLODDistance方法。

three.js的render、object3D或者其他函数提供了能够检测到当前浏览器显示对象发生了平移,旋转,缩放或者相机视点发生了变化返回值或方法吗?

阅读 5.3k
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题