【发布时间】:2015-06-26 22:12:07
【问题描述】:
我正在开发 Three.js 的一些个人项目。我正在使用requestAnimationFrame 函数。我想每 2 秒调用一次函数。我已经搜索过,但找不到任何有用的东西。
我的代码是这样的:
function render() {
// each 2 seconds call the createNewObject() function
if(eachTwoSecond) {
createNewObject();
}
requestAnimationFrame(render);
renderer.render(scene, camera);
}
有什么想法吗?
【问题讨论】:
标签: javascript three.js requestanimationframe