【发布时间】:2016-04-04 00:19:56
【问题描述】:
在 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( animate );或查看this answer。 -
当你注释掉 requestAnimationFrame 时,窗口永远不会刷新。
-
实际上,ti 现在似乎可以工作了。刷新问题
标签: three.js