POV-Ray : Newsgroups : povray.advanced-users : output an octree file : Re: output an octree file Server Time
29 Jun 2024 01:47:49 EDT (-0400)
  Re: output an octree file  
From: clipka
Date: 13 Aug 2010 12:17:17
Message: <4c65700d$1@news.povray.org>
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

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.