Jump to content

  • Log In with Google      Sign In   
  • Create Account


#Actualglf1311

Posted 28 October 2012 - 11:45 AM

actually u are calling both render and moveCube once, but in your render function u request an AnimationFrame which makes sure that your render function is called 60 times a second.As your moveCube does not request such an AnimationFrame its just called once. You could either fix that by adding an RequestAnimationFrame-call to it or , and this is the way i would do it, by calling moveCube inside your render function. Here is a example how u could do it http://jsfiddle.net/ywarw/2/.

regards glf

ps: if u found this useful feel free to click the "up"-arrow

#1glf1311

Posted 28 October 2012 - 11:42 AM

actually u are calling both render and moveCube once, but in your render function u request an AnimationFrame which makes sure that your render function is called 60 times a second.As your moveCube does not request such an AnimationFrame its just called once. You could either fix that by adding an RequestAnimationFrame-call to it or , and this is the way i would do it, by calling moveCube inside your render function. Here is a example how u could do it http://jsfiddle.net/ywarw/2/.

regards glf

ps: if u found this usefull feel free to click the "up"-arrow

PARTNERS