Tag Info

Hot answers tagged

5

A physics engine being tied to a particular renderer shows horrible separation of concerns and really shouldn't happen. In fact, it doesn't. Box2D-js can visualise the simulation with a canvas, but is in no way required to do so. It is possible to extract the information you want and drive some other visualisation with it. PhysicsJS has a custom renderer ...


1

This is a simple example of linear interpolation. In this formula: timeA and valueA are your first fixpoint timeB and valueB are your second fixpoint timeN and valueN are the point you are looking for valueN = valueA + (valueB-valueA) * ( (timeN - timeA) / (timeB - timeA) ) When you want a smoother interpolation around your fixpoints, you could go for ...



Only top voted, non community-wiki answers of a minimum length are eligible