|
![](/i/fill.gif) |
Ron Parker wrote:
> > I asked yesterday when I could have a copy of the new version
> > of the "Super Patch" and was told to "bugger off" (so to speak :).
>
> You were not. I was joking, as I thought you were. Furrfu. I really
> don't know when it will be online, it depends heavily on what else is
> going on in my life. Nevertheless, every time I mention it I get asked
> when it's going to be back online, despite the fact that I've said more
> than once that I really don't know.
I was taking yet another friendly swipe when I mentined the above.
> If you're intersecting a ray with a planar mirror, trace isn't really
> necessary because the operation is so simple. Here's a macro to find
> it, borrowed somewhat from the POV source.
>
> #macro IntersectPlane( _PlaneNormal, PlaneOffset, RayInitial, _RayDirection )
> #local PlaneNormal=vnormalize(_PlaneNormal+<0,0,0>);
> #local RayDirection=vnormalize(_RayDirection+<0,0,0>);
> #local NormalDotDirection = vdot(RayDirection, PlaneNormal);
> #if ( abs(NormalDotDirection) < 0.00001 )
> #error "Ray parallel to mirror"
> #end
> #local NormalDotOrigin = vdot( RayInitial, PlaneNormal );
> #local Depth=(PlaneOffset - NormalDotOrigin) / NormalDotDirection;
> RayInitial+Depth*RayDirection
> #end
>
> Of course, this assumes you haven't done anything with the mirror, like
> rotating or scaling it. If you've done that, you'll have to fix the
> normal and offset appropriately.
>
> Translate is
> #declare Offset=Offset+(Normal*Translation);
>
> Rotate is trickier - you have to multiply the normal vector by the
> transpose of the rotation matrix. If you rotate before you translate,
> though (and you probably will) you can no doubt find an easier way to
> find the new normal. Hope this all helps.
I think I have a simple yet elegant solution in the works. Since
I have abandoned the photon technique in favor of simply connecting
cylinders from each mirror surface to the next John Van Sickles
connect the dots macro handles it well and I know how to use it
from previous experience.
Thank you for taking the time to offer assistance.
--
Ken Tyler
mailto://tylereng@pacbell.net
Post a reply to this message
|
![](/i/fill.gif) |