|
|
Am 13.08.2010 13:03, schrieb jazzman:
> 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'd suggest to...
- Test the scene objects one by one, unless they're very close to each
other.
- For each object, restrict your testing to the bounding box as given by
min_extent() and max_extent().
- Use 2x N^2 calls to trace() from two opposite sides of the bounding
box, to further narrow down the subset of the bounding box where you
have to use a series of inside() tests. (Obviously, you don't need to
test on a line that doesn't intersect with the object anywhere.)
Post a reply to this message
|
|