|
![](/i/fill.gif) |
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] spiritone com
The POV-Ray Cyclopedia http://www.spiritone.com/~english/cyclopedia/
Post a reply to this message
|
![](/i/fill.gif) |