POV-Ray : Newsgroups : povray.general : Math question regarding interpolation of orientations : Re: Math question regarding interpolation of orientations Server Time
2 Aug 2024 02:23:23 EDT (-0400)
  Re: Math question regarding interpolation of orientations  
From: Sascha Ledinsky
Date: 29 Jan 2005 06:17:44
Message: <41fb70d8$1@news.povray.org>
Thanks Tim!

The only thing I don't understand is "you could still just go ahead and 
interpolate t cubic instead of linear"... Wouldn't I need additional 2 
quaternions (that is, q0, q1, q2 and q3) to cubically interpolate 
between q1 and q2 (to construct something like a catmull-rom spline)?

But well, I'll first start with implementing the slerp formula and see 
how far I get with cubic interpolation. Maybe I'll be back with some 
more questions :-)

Thanks again,
-Sascha

But well, I'll first start with implementing the slerp formula
Tim Nikias wrote:
> Slerp is a very simple algorithm, once you've understood the basics. To
> slerp-interpolate, you still use a linear parameter t, just that it is used
> as a multiplier for an angle inside a sine-evaluation.
> 
> So, you could still just go ahead and interpolate t cubic instead of linear,
> and there you go: cubic slerp interpolation.
> 
> The formula for the slerp is this:
> 
> q1 and q2 are two quaternions, alpha is the angle between the two,
> calculated like this:
> alpha = acos( s1*s2+vdot(v1,v2)) , where s1 and s2 are the real parts of the
> quaternion, and v1 and v2 are the imaginary vector parts.
> 
> So q(t) = (sin((1-t)*alpha)/sin(alpha))*q1 + (sin(t*alpha)/sin(alpha))*q2
> 
> With a little googling and some math you should be able to get this working
> properly.
> 
> Regards,
> Tim
> 
> PS: I'm planning to implement quaternions and interpolations etc myself at
> some point, but am currently occupied with some exams and my hair-macros...
> ;-)
>


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.