|
|
Rune wrote:
> Imagine two vectors, A and B.
> C is a regular weighted average of the two vectors, say clock*A +
> (1-clock)*B.
>
> With this type of average the vector-point is linearly "interpolated", but
> the rotation and length of the vector is not.
>
> To make the length of C linearly interpolated is easy, but how do I linearly
> interpolate the "rotation"?
>
> I need a general method that can average not just two, but multiple vectors.
> How can I do this?
Make normalized copies of the two vectors, a and b.
Find the angle, A, between them: 2*asin(vlength(b-a)/2).
The vector you want is (a+b)/2 + tan(-A/2+A*clock)*vlength((a+b)/2)*vnorm(b-a)
Where clock goes from 0 to 1 from vector a to vector b.
--
David Fontaine <dav### [at] faricynet> ICQ 55354965
My raytracing gallery: http://davidf.faricy.net/
Post a reply to this message
|
|