Skip to content

Interpolation

Alan Jefferson edited this page Jan 23, 2020 · 1 revision

Let's have a look at stepping through time inbetween values provided by your user or application.


Simulation

Let's say your animation looks like this.

std::vector<vec3> positions {
  { 0.0f, 0.0f, 0.0f },  // frame 1
  { 0.0f, 1.0f, 0.0f },  // frame 2
  { 0.0f, 2.0f, 0.0f },  // ..
  { 0.0f, 2.0f, 0.0f },
  { 0.0f, 1.0f, 0.0f },
  { 0.0f, 0.0f, 0.0f },  // frame n
};

And you'd like for a simulated sphere to follow that animation with a force proportional to the distance between the target and simulated positions.

Easy.

WIP

rigid->