|
![](/i/fill.gif) |
Am 12.08.2010 23:55, schrieb jazzman:
> Also, how does the macro "trace" help me find out which cubes contain objects?
> From my understanding, the macro traces a specific ray and returns its color.
Not exactly; actually the inbuilt function "trace(...)" does trace a
ray, but returns an intersection point (with some specified object)
instead. By systematically shooting multiple rays at an object (or set
of objects), you can determine (to some degree of accuracy) which space
is indeed occupied by it (as opposed to min_extent() and max_extent(),
which only give you the extent of a box that is guaranteed to encompass
all of the respective object, but may be larger than strictly needed).
An alternative would be the inside() function, which tests whether a
given point is inside the object. It may be more straightforward to use
and also give better results for concave objects, but may also require
more time, as you'll have to use N^3 tests as opposed to N^2 tests for
the trace() approach.
Post a reply to this message
|
![](/i/fill.gif) |