News for hackers. Stuff that matters.
Re:3D graphics in JavaScript (no libraries) by Scene_Cast2 on Tuesday February 11, 2014 @04:04PM (#7220437)
Something I often see missing in JS demos is fps-correct animations. Sure, the

  drawInterval = setInterval(plot, 10);
and

  angle += .05;
will work on default settings with no bottleneck, but put in "Manual Bresenham" and the animation slows down.

Back in the days of Flash, this was solved with tweening libraries that took in a curve (how to interpolate between the end values), and passing a variable reference that could be updated in an fps-agnostic fashion.

Here's my idea for a framerate-independent graphics library. Have a function pointer to the main draw( time T ) call, and one of the requirements would be that time T does not represent the current time and can be out of order ( draw(1), draw(3), draw(2) ). In other words, draw() would have to be pseudo-functional. This approach would allow for some neat tricks such as cashing, multithreaded and split-rendering, motion blur tricks, etc.

Re:3D graphics in JavaScript (no libraries) by yoha on Tuesday February 11, 2014 @04:20PM (#7220545)
Re:3D graphics in JavaScript (no libraries) by Timmmmbob on Tuesday February 11, 2014 @05:35PM (#7221011)
No he means it doesn't do:

angle += time_taken_to_render_previous_frame * speed;