When I write code like this:
function renderuj(){
scene.renderer.setClearColor(0xeeeeee, 1);
ob1.animation.update(0.5);
ob2.animation.update(0.5);
scene.renderer.render(scene.scene, scene.camera);
animationFram = requestAnimationFrame(renderuj);
}
The animation continues to loop, but I want it to play only once without repeating. How can I achieve that?
In the .js file where the 3D animation/object is located, we can find this snippet:
animation" : [{"name":"test1","fps":24,"length":10
I tried to modify my code like this:
if(temp < 10)
temp++;
else
cancelRequestAnimFrame(animationFram);
However, this approach only plays half of the animation. Any suggestions on what I should do?