Skip to content

JS port of Blender's animation bezier curve evaluator

License

Notifications You must be signed in to change notification settings

chromakode/fcurve

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fcurve

Build Status Coverage Status npm npm

Blender uses bezier curves to control animations called FCurves. This library is a port of the evaluator. Given the same control point information, it should produce the same output (within a few points of numeric precision). This is verified by running Blender with the same curves and comparing the values. (:warning: though we're not getting 100% code coverage yet)

Currently, only the bezier interpolation mode is fully supported.

In JS, FCurves should be represented like this:

{
  points: [
    {
      // point interpolation mode (only 'BEZIER' supported)
      interpolation: 'BEZIER',
      // (x, y) coordinate of point
      co: [10, 0],
      // (x, y) coordinate of left handle
      left: [-50, 0],
      // (x, y) coordinate of right handle
      right: [50, 0],
    },
    {
      interpolation: 'BEZIER',
      co: [120, -3],
      left: [70, -3],
      right: [170, -3],
    },
  ]
}

About

JS port of Blender's animation bezier curve evaluator

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published