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

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或者其他函数提供了能够检测到当前浏览器显示对象发生了平移,旋转,缩放或者相机视点发生了变化返回值或方法吗?

【热门文章】
【热门文章】