【发布时间】:2013-10-18 21:39:08
【问题描述】:
我在运行动画时遇到问题。这是在var ob1 = function() {}; 里面。调用时,它会运行一段时间,然后我收到错误Uncaught RangeError: Maximum call stack size exceeded。但是,同样的结构在对象之外运行没有问题。
/////////////// Render the scene ///////////////
this.render = function (){
renderer.render(scene,camera);
if(isControls == true) controls.update(clock.getDelta());
this.animate();
//console.log(true);
requestAnimationFrame(this.render());
}
/////////////// Update objects ///////////////
this.animate = function (){
console.log("!");
}
【问题讨论】:
-
requestAnimationFrame期待回调,你只是传递了undefined。
标签: javascript three.js requestanimationframe