POV-Ray : Newsgroups : povray.advanced-users : output an octree file : Re: output an octree file Server Time
29 Jun 2024 01:50:55 EDT (-0400)
  Re: output an octree file  
From: jazzman
Date: 13 Aug 2010 07:05:00
Message: <web.4c652680e632d53ac1f7a70f0@news.povray.org>
clipka <ano### [at] anonymousorg> 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

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