|
|
On Thu, 08 Sep 2005 04:07:01 -0400, Mike Williams
<nos### [at] econymdemoncouk> wrote:
> #macro Reorient_Trans_Sky(vec, Sky)
> #local mapxto = vnormalize(vec);
> #local mapzto = vnormalize(vcross(Sky, vec));
> #local mapyto = vnormalize(vcross(mapxto, mapzto));
> matrix <
> mapxto.x, mapxto.y, mapxto.z,
> mapyto.x, mapyto.y, mapyto.z,
> mapzto.x, mapzto.y, mapzto.z,
> 0,0,0
> >
> #end
> #macro aligned_box(P1, P2, H, W)
> #local L = abs(vlength(P2-P1));
> box {<0,-H/2,-W/2><L,H/2,W/2>
> transform {Reorient_Trans_Sky(P2-P1,y)}
> translate P1
> }
> #end
Works great! This is insanely useful.
--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
Post a reply to this message
|
|