|
![](/i/fill.gif) |
OK. This should, in theory, do the trick, but it's untested code.
I'm going to take the box
box {<0,0,0>,<L,H,W>}
and make it fit your four points. The point <0,0,0> on the box will
correspond to the point pBb (the back right of the train car).
(pAf, pBf, pAb, pBb must be predefined)
#declare newx = vnormalize(pBf-pBb);
#declare newz = vnormalize(pAb-pBb);
#declare newy = vcross(newz,newx);
matrix <
newx.x,newx.y,newx.z,
newy.x,newy.y,newy.z,
newz.x,newz.y,newz.z,
pBb.x,pBb.y,pBb.z
>
Give that a shot.
- Slime
[ http://www.slimeland.com/ ]
Post a reply to this message
|
![](/i/fill.gif) |