POV-Ray : Newsgroups : povray.general : vrotate? : Re: vrotate? Server Time
30 Jul 2024 10:24:03 EDT (-0400)
  Re: vrotate?  
From: clipka
Date: 5 Mar 2009 05:45:00
Message: <web.49afac96ed80e874f567c3de0@news.povray.org>
"[GDS|Entropy]" <gds### [at] hotmailcom> wrote:
> I'm looking through the docs and see that vrotate *seems* to do what I'm
> looking for; that is to have a vector A which is rotated by a vector B.
>
> So this would mean that if I have two vectors, say the top and bottom of a
> cyl, that I could, using vrotate, arbitrarily rotate the top of the cyl
> while leaving the bottom in place?
>
> If so, sweet, and can vrotation be used to determine the effect of vrotate?
> Would vcross give the perpendicular axis needed in vrotation, if its inputs
> were vector A and vector B from above?

Um... unfortunately, rotation stuff is quite complex, and I know neither whether
you got the docs right nor whether I get you right :}

First off, vrotate(A,B) does the same thing to vector A that an "object { O
rotate B }" does to the whole object O; i.e., B does not specify the axis to
rotate about, but rather a set of three consecutive rotations about the X, Y
and Z axes respectively.

For that reason, computing the dot product of A and B makes absolutely no sense.


Speaking of the VRotation macro and the perpendicular axis, the thing you should
input to - say - VRotation(A,B,C) - as C is c*VCross(A,B), where c is an
arbitrary float constant, of which only the size matters.

Actually, to my knowledge the only added value of VRotation over VAngle is that
while VAngle just gives you the angle between two vectors, VRotation will add
some direction information to this angle.


Maybe the best thing is you tell us what you actually want to do; vector stuff
involving rotations is quite a complex topic (as you can probably see from the
number of macros related to it).


Post a reply to this message

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