Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better mapping of Blender curves to Calcium curves #10

Open
io7m opened this issue Dec 3, 2016 · 0 comments
Open

Better mapping of Blender curves to Calcium curves #10

io7m opened this issue Dec 3, 2016 · 0 comments

Comments

@io7m
Copy link
Owner

io7m commented Dec 3, 2016

Right now, the mapping is:

Blender  | Calcium
---------------------------------------
CONSTANT | CURVE_INTERPOLATION_CONSTANT
LINEAR   | CURVE_INTERPOLATION_LINEAR
EXPO     | CURVE_INTERPOLATION_EXPONENTIAL

The problem is that the obvious definition of linear is:

linear :: Double -> Double -> Double
linear x0 x1 factor = (x0 * (1 - factor)) + (x1 * factor);

... and therefore the obvious definition in Calcium for "exponential" is:

exponential :: Double -> Double -> Double
exponential x0 x1 factor = linear x0 x1 (factor * factor)

Unfortunately, this gives results that are more like QUADRATIC in Blender. In order to yield results that are more like Blender's idea of EXPO, the definition looks more like:

exponential :: Double -> Double -> Double
exponential x0 x1 factor = linear x0 x1 (factor * factor * factor * factor * factor * factor * factor * factor)

The actual Blender definitions are given in:

https://developer.blender.org/diffusion/B/browse/master/source/blender/blenlib/intern/easing.c$252

At the very least, Calcium's EXPONENTIAL should probably match Blender's EXPO, and the previous definition for EXPONENTIAL should probably be renamed QUADRATIC to match Blender's idea of quadratic.

@io7m io7m self-assigned this Dec 3, 2016
io7m added a commit that referenced this issue Dec 3, 2016
This is working towards skeleton evaluation. The
`CaEvaluatorSingleActionCurves` type separately evaluates the
translation, orientation, and scale, for a given bone in a skeleton
for a given action.

Add quadratic interpolation.

Affects #10
Affects #7
@io7m io7m added this to the 0.1.0 milestone Jan 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant