|
|
I just tackled this problem myself:
given vectors v0, v1 (I assume they are at the origin)
#declare vn = vnormalize(vcross(v0,v1));
#declare v2 =
vaxis_rotate(v0,vn,clock*degrees(acos(vdot(vo,v1)/(vlength(v0)*vlength(v1)))));
v2 is in the right direction, so normalize it and adjust the length normally.
Josh
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?
>
> Rune
> --
> \ Include files, tutorials, 3D images, raytracing jokes,
> / The POV Desktop Theme, and The POV-Ray Logo Contest can
> \ all be found at http://rsj.mobilixnet.dk (updated January 6)
> / Also visit http://www.povrayusers.org
--
Josh English -- Lexiphanic Lethomaniac
eng### [at] spiritonecom
The POV-Ray Cyclopedia http://www.spiritone.com/~english/cyclopedia/
Post a reply to this message
|
|