|
![](/i/fill.gif) |
FrogRay wrote:
> I don't think that PovRay would look at every possible point between the
> starting point and the target object. However, imagine using trace where
> the target object was a complex CSG object, mesh, isosurface, etc. The
> maths involved here would be more than a mere simultaneous equation and
> admittedly, at this point, I would simply throw my hands up in despair if
> asked to do it by hand. On the other hand, I don't how complex (or simple)
> this sort of geometry really is.
It's really quite simple. For CSG, POV-Ray traces each member object,
and then deals with the set of results.
It's easier to explain with an example, so here's one:
union {
merge {
A
B
}
C
}
When tracing this object, POV-Ray will find each intersection between
the ray with the three separate objects A, B and C. We'll call the
resulting set of points R (or would it be R[] or [R]? It's been a while
since I've done this kind of notation).
A and B are merged, so every point in R from A is checked if it's inside
of B. If it is, then it is removed. If it isn't, then it is retained.
Then, the same thing is done in reverse, checking points from B to see
if they're inside of A.
The resulting set is union'ed with C, so the intersections from C are
just added to R.
Then, POV-Ray just looks for the closest point in R, and returns that as
your result.
So, the overall algorithm is a bit more complex, but only a little, and
it still ends up being very fast. It doesn't really change the math at
all, it just changes how you process the result.
...Chambers
PS Thorsten, Warp, if either of you are going to nitpick something I
said, please remember that I have the best of intentions and I am
sincerely sorry for any errors! :)
Post a reply to this message
|
![](/i/fill.gif) |