|
|
Thanks a bunch! I finally understand the transformation matrix. The
documentation isn't very good.
Josh English wrote:
> There is a standard orientation macro that looks like this:
>
> #macro Orient(v1,v2)
> #local nx = vnormalize(v2 - v1);
> #local nz = vnormalize(vcross(nx,y));
> #local ny = vcross(nz,nx);
> matrix <nx.x,nx.y,nx.z,
> ny.x,ny.y,ny.z,
> nz.x,nz.y,nz.z,
> v1.x,v1.y,v1.z>
> #end
>
> This only works if the object "faces" the positive x axis... so you might
> want to rotate your torus by 90*z before including the macro:
>
> torus { 1, 0.25 // or whatever
> rotate 90*z
> Orient(thisvector, thatvector) }
>
> It is possible (and I've don't it before but I don't have the file handy)
> to rearrange the first three lines of the macro that will make the
> rotation command unnecessary.
>
> Good Luck
>
Post a reply to this message
|
|