Skip to content

Latest commit

 

History

History
49 lines (31 loc) · 2.15 KB

frame-based-animation.md

File metadata and controls

49 lines (31 loc) · 2.15 KB
uid
46a08b79-6346-4803-8bd0-d6666570b5c8

Frame-based Animation

Related nodes

to built up your loops:
FrameDelay (Value)

to accumulate values over time or get changes between frames:
Integrate (Differential)
FrameVelocity (Animation)
FrameDifference (Animation)

to measure time itself:
StopWatch (Value)

nodes that are frame-based implementations of some algorithm:
ADSR (Value Framebased)
Spray (Animation)
Wanderer (Animation 2d)
Wanderer (Animation 3d)

Scenario: an object shall react to events by applying forces.
There are different famous examples of this way of doing animations:

  • BOIDS
  • Physics engines, like Box2D or Bullet (included in DX11).

But you also can do your own frame-based animation, simply by patching.

The basic idea here is that the current value of the animation is simply calculated based upon the value of the last frame and tweaked a bit in a certain way. See more about Loops.

When doing this naively, higher frame rates will result in faster animations. To avoid that, here is a simple trick:

  • measure how much time has passed between the last frame and the current frame. A combination of Stopwatch (Animation) and FrameDifference (Animation) can help you out.
  • scale your velocity and acceleration by this amount

As a result your animation will be framerate independent.

See also: