Re: [css-transforms-1] SLERP edge case behaviour

On Mon, Jul 6, 2015 at 8:31 PM, Shane Stephens <shans@google.com> wrote:
> Hi list,
>
> Here's how we currently define quaternion SLERPing during interpolation:
> http://dev.w3.org/csswg/css-transforms/#interpolation-of-decomposed-3d-matrix-values
>
> When quatA = [0, 1, 0, 0] and quatB = [0, -1, 0, 0], this has the
> unfortunate side effect of setting product to -1, which means the definition
> of 'w' has 0 in the denominator.
>
> What do?

Something analogous to the early exit when product is 1, I would
assume. I don't know how math works, so I'm not sure what the right
answer is.

(By the way, the clamping code is exactly wrong. It should use min()
for the upper bound and max() for the lower bound; as written, it
ensures that product is *outside* the (-1,1) range.)

~TJ

Received on Wednesday, 8 July 2015 19:22:00 UTC