POV-Ray : Newsgroups : povray.advanced-users : Vector Turns - Reposted : Re: Vector Turns - Reposted Server Time
30 Jul 2024 00:26:13 EDT (-0400)
  Re: Vector Turns - Reposted  
From: Josh English
Date: 6 Sep 2000 18:13:24
Message: <39B6C177.A4A6C696@spiritone.com>
You want to use one of John VanSickles Matrix transformations, it sounds like.

#macro Reorient(Axis1,Axis2)
  #local vX1=vnormalize(Axis1);
  #local vX2=vnormalize(Axis2);
  #local vY=vnormalize(vcross(vX1,vX2));
#if (vlength(vY)>0)
  #local vZ1=vnormalize(vcross(vX1,vY));
  #local vZ2=vnormalize(vcross(vX2,vY));
  matrix < vX1.x, vY.x,vZ1.x, vX1.y,vY.y,vZ1.y, vX1.z,vY.z, vZ1.z, 0,0,0 >
  matrix < vX2.x,vX2.y,vX2.z,  vY.x,vY.y, vY.z, vZ2.x,vZ2.y,vZ2.z, 0,0,0 >
#end
#end

Josh
David Vincent-Jones wrote:

> Can somebody please tell me why the Turn is not working....
>
> #declare Start=<0,0,20>
> #declare End=<8,0,30>
> #declare Dist=vlength(Start-End);
> #declare Turn=vrotate(Start,End);
>
> box {<-1,-1,-1>,<1,1,1> texture {pigment {checker color Black, color
> White } }
> scale <(Dist),1,1>     translate<-Dist,0,0>     rotate y*Turn      translate
> End
>  }
>
> I am trying to place a box with ends centered and directly sitting on the
> Start and End vectors...
> As a result I cannot directly use the box corners for location purposes.
>
> The use of 'Turn' is intended to rotate (orientate) the object prior to the
> final translate.
>
> Or is there an easier way to do this? Maybe a simple vector matrix approach.
>
> David V-J

--
Josh English -- Lexiphanic Lethomaniac
eng### [at] spiritonecom
The POV-Ray Cyclopedia http://www.spiritone.com/~english/cyclopedia/


Post a reply to this message

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