|
![](/i/fill.gif) |
Ben Chambers wrote:
>
> I have a vector which is perpendicular to a plane.
> From this vector, how should I rotate an object so
> that it lies in the plane? The vector is represented
> by a point along that axis.
>
Not sure what you need, but you might want to try John VanSickle's
Reorient macro:
#macro Reorient(Axis1,Axis2)
#local vX1=vnormalize(Axis1);
#local vX2=vnormalize(Axis2);
#local vY=vnormalize(vcross(vX1,vX2));
#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
--
Margus Ramst
Personal e-mail: mar### [at] peak edu ee
TAG (Team Assistance Group) e-mail: mar### [at] tag povray org
Home page http://www.hot.ee/margusrt
Post a reply to this message
|
![](/i/fill.gif) |