Understanding Quadratic Bézier Curves(antoineleclair.ca) |
Understanding Quadratic Bézier Curves(antoineleclair.ca) |
http://www.jasondavies.com/animated-bezier/
http://www.jasondavies.com/animated-bezier/animated-bezier.j...
This is just a fact of life with splines. They have non-uniform speed in their raw form and you have to deal with it. It's also why quaternion slerping being constant angular speed isn't a real advantage over lerp-and-normalize because they both trace out the same path and often you'll want to overlay a speed curve anyway (and lerp-and-normalize's speed is only barely non-uniform). Evaluate-and-normalize is the way to go for quaternions. It works great for multi-way skeletal animation blending and higher-order rotation interpolation (just do the spline evaluation in R^4 and project back onto the unit sphere). Casey has an old email that goes into some of this: http://mollyrocket.com/911.txt
This happens in any specialization... An endocrinologist and a radiologist, for example, probably only speak half of the same medical language.
http://en.wikipedia.org/wiki/Bezier_curve#Constructing_B.C3....
Draggable Cubic Bézier curve: http://ontouchstart.posterous.com/explore-svg-with-coffeescr...
Cubic Bézier timing function CSS: http://ontouchstart.posterous.com/explore-svg-with-coffeescr...
http://www.wolframalpha.com/input/?i=integrate+sqrt%28a+x^2+...
This page documents the derivation in more detail:
http://segfaultlabs.com/docs/quadratic-bezier-curve-length
But should you use this for reparameterization? One great thing about calculating arc length by numerical quadrature is that you get all the intermediate arc lengths for the initial segments of the curve for free as intermediate results. Those are exactly what you need for reparameterization, and it works for polynomial and rational curves of any degree whatsoever, not only quadratics.
By contrast, there's no way you could find a closed-form expression for the _inverse_ of that arc length function for reparameterization, so you'd still need to do the same old iterative inversion thing of tabulating it at a bunch of points and then inverting the table and lerping between the gaps. The incremental evaluation required for that is a much better fit for numerical quadrature. If you have to do one, you might as well do both.
But the reality is that if the curve looks pretty smooth, the animation will be pretty smooth. By computing the change in derivative at the singular point you can figure out how big the jump is, and then try to minimize it.