|
![](/i/fill.gif) |
clipka <ano### [at] anonymous org> wrote:
> 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.
Actually, I need to know for every cube in the scene if it contains an object
(not for every square on the screen). So I need to perform N^3 tests anyways.
I can't seem to find any documentation on the "inside()" function. Could you
please refer me to some?
Post a reply to this message
|
![](/i/fill.gif) |