POV-Ray : Newsgroups : povray.advanced-users : output an octree file : Re: output an octree file Server Time
29 Jun 2024 02:06:04 EDT (-0400)
  Re: output an octree file  
From: clipka
Date: 13 Aug 2010 05:33:34
Message: <4c65116e$1@news.povray.org>
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

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