0
在three.js中测试代码时,不需要动画。我可以看到第一个渲染帧。这样可以降低功耗,并且可以在显卡升温时阻止笔记本电脑上的风扇进入。如何关闭three.js中的动画
在three.js所的例子具有以下结构:
function init() {
animate()
}
function animate() {
requestAnimationFrame(animate);
render();
targetRotation = targetRotationOnMouseDown + (mouseX - mouseXOnMouseDown) * 0.05;
}
function render() {
group.rotation.y += (targetRotation - group.rotation.y) * 0.05;
renderer.render(scene, camera);
}
我不知道如何关闭重复调用动画。 有没有简单的方法来关闭动画?
作为一个快速黑客,只是注释掉'requestAnimationFrame(动画);'或参见[这个答案](HTTP ://stackoverflow.com/questions/14465495/how-do-i-stop-requestanimationframe/14466255#14466255)。 – WestLangley
当您注释掉requestAnimationFrame时,窗口不会刷新。 – Dov
其实,现在看起来像ti的工作。刷新问题 – Dov