मुझे एनीमेशन चलाने में परेशानी हो रही है। यह var ob1 = function() {};
के अंदर है। जब बुलाया जाता है, यह थोड़ी देर के लिए चलता है और फिर मुझे Uncaught RangeError: Maximum call stack size exceeded
त्रुटि मिलती है। हालांकि, इस संरचना में वस्तु के बाहर चलने में कोई समस्या नहीं है।चल रहे अनुरोधएनीकरण एक नई वस्तु के भीतर से
requestAnimationFrame(this.render);
जब से तुम render
अंदर this
उपयोग कर रहे हैं, तो आप शायद bind
की आवश्यकता होगी::
/////////////// 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' कॉलबैक की अपेक्षा करता है, आप बस 'अपरिभाषित' गुजर रहे हैं। – elclanrs