Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Point and Spring Simulation | Better HN
Point and Spring Simulation
(ichub.io)
12 points · by
ichub
· 11y ago · 2 comments
Comments
[–]
bemmu
11y ago
Calling requestAnimationFrame again after drawing the previous frame gives smoother results, no need for setInterval. You can know how much to update the physics by seeing how much Date.now() has changed since the previous frame.
[–]
ichub
OP
11y ago
Thanks for the suggestion, I implemented it:
https://github.com/ichub/physics/commit/5b875ea2d5e3dfa3f5a0...