|
|
Wasn't it Gyscos who wrote:
>It might work with convex objects. But if there is a hole inside the object, I
>may never find it with trace.
>Besides, from where would I "send" the trace vectors ? It would need to be from
>outside the object, but I don't know the size of the object... (ok, we
>could add
>a size parameter to the macro...)
You could fire the trace rays outwards from the centre of the object
instead of inwards from outside the object. You get worse problems with
holes because in some circumstances you'd find the hole instead of the
outer surface. You need to know the location of the centre, but you'd
need that anyway when tracing inwards.
You might think that you could fix the problem with non-convex objects
by always firing a continuation ray. When trace finds something, always
assume that you've hit a hole, and perform another trace from that point
using the same direction. Repeat the process until trace doesn't find
anything. This will find all parts of the surface, but in some
circumstances it's going to be rather difficult to work out how to add
wires to connect the various patches of surface that are found.
[Consider the situation of tracing a torus.]
The continuation ray idea works slightly better when tracing outwards,
because if you trace inwards your continuation rays go right through the
centre and find the other side of the object.
--
Mike Williams
Gentleman of Leisure
Post a reply to this message
|
|