|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Hi all,
I was wondering if someone knows if there's an option to output an octree of the
rendered scene from POV-ray. All I need is to know for each cell in a 3d grid of
the scene whether it's occupied or not.
Any help would be greatly appreciated,
Jazzman
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
jazzman wrote:
> I was wondering if someone knows if there's an option to output an octree of the
> rendered scene from POV-ray. All I need is to know for each cell in a 3d grid of
> the scene whether it's occupied or not.
I'm not sure if the internal data built during the render
is suitable for your needs, but even if so you'd need to
modify the source code of POV-Ray to get at it.
Alternatively, you can divide the scene into cubes in SDL
and use the trace function to check if they're empty or not
(within some error margin). In 3.7 you could even write
the data out in a binary format (such as df3).
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On 08/10/2010 04:58 PM, Christian Froeschlin wrote:
> jazzman wrote:
>
>> I was wondering if someone knows if there's an option to output an
>> octree of the
>> rendered scene from POV-ray. All I need is to know for each cell in a
>> 3d grid of
>> the scene whether it's occupied or not.
>
> I'm not sure if the internal data built during the render
> is suitable for your needs, but even if so you'd need to
> modify the source code of POV-Ray to get at it.
>
> Alternatively, you can divide the scene into cubes in SDL
> and use the trace function to check if they're empty or not
> (within some error margin). In 3.7 you could even write
> the data out in a binary format (such as df3).
see also this:
http://wiki.povray.org/content/Documentation:Reference_Section_2.5#The_.23write_Directive
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On 08/10/2010 07:16 PM, Jim Holsenback wrote:
> On 08/10/2010 04:58 PM, Christian Froeschlin wrote:
>> jazzman wrote:
>>
>>> I was wondering if someone knows if there's an option to output an
>>> octree of the
>>> rendered scene from POV-ray. All I need is to know for each cell in a
>>> 3d grid of
>>> the scene whether it's occupied or not.
>>
>> I'm not sure if the internal data built during the render
>> is suitable for your needs, but even if so you'd need to
>> modify the source code of POV-Ray to get at it.
>>
>> Alternatively, you can divide the scene into cubes in SDL
>> and use the trace function to check if they're empty or not
>> (within some error margin). In 3.7 you could even write
>> the data out in a binary format (such as df3).
>
> see also this:
>
http://wiki.povray.org/content/Documentation:Reference_Section_2.5#The_.23write_Directive
probably should also mention ... requires at LEAST v3.7.beta.32
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Christian Froeschlin <chr### [at] chrfrde> wrote:
> jazzman wrote:
>
> > I was wondering if someone knows if there's an option to output an octree of the
> > rendered scene from POV-ray. All I need is to know for each cell in a 3d grid of
> > the scene whether it's occupied or not.
>
> I'm not sure if the internal data built during the render
> is suitable for your needs, but even if so you'd need to
> modify the source code of POV-Ray to get at it.
>
> Alternatively, you can divide the scene into cubes in SDL
> and use the trace function to check if they're empty or not
> (within some error margin). In 3.7 you could even write
> the data out in a binary format (such as df3).
Could you please specify how exactly I'm supposed to divide the scene up into
cubes? I'm not an expert in the SDL, so pointers to specific functions would be
helpful.
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.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On 08/13/2010 08:03 AM, jazzman wrote:
> I can't seem to find any documentation on the "inside()" function. Could you
> please refer me to some?
It's alphabetically listed in this section:
http://wiki.povray.org/content/Documentation:Reference_Section_2#Functions
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"Jim Holsenback" <jho### [at] povrayorg> schreef in bericht
news:4c652fc3@news.povray.org...
> On 08/13/2010 08:03 AM, jazzman wrote:
>> I can't seem to find any documentation on the "inside()" function. Could
>> you
>> please refer me to some?
>
> It's alphabetically listed in this section:
> http://wiki.povray.org/content/Documentation:Reference_Section_2#Functions
>
... or the "quick and dirty" search for "inside" in the Index of Help. ;-)
Thomas
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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
|
|
| |
| |
|
|
|
|
| |