I called my render(); function inside an interval.
And now, every 5 seconds the cube.rotation seems to speed up:
http://jsfiddle.net/Schoening/ArCW2/
Why is my Function "Speeding up" (With JsFiddle example) (Solved)
Started by Schoening, Oct 28 2012 07:26 AM
2 replies to this topic
Ad:
#2 Members - Reputation: 292
Posted 28 October 2012 - 10:45 AM
Your mistake is that u call requestAnimationFrame AND setInterval. setInterval calls your render function every 5sec and render calls requestAnimationFrame which makes sure ur frame is drawn 60(?) times a second. Now everytime setInterval calls render another AnimationFrame is requested and ur frame is drawn additional 60 times a second.
I would try something like this http://jsfiddle.net/ArCW2/1/
Regards glf
I would try something like this http://jsfiddle.net/ArCW2/1/
Regards glf






