|
|
Hey all,
I'm trying to wrap my mind around how POV-Ray uses the octree structure.
I've
done some reading on octrees, and have a decent mental picture of what they
are (I've even drawn diagrams for myself). However, I am getting stuck in
the
following areas:
1) What exactly do the OT_ID (in octree.h) data items x,y,z, and size
represent? Is x,y,z the the corner of the cube (node)? If so, which corner?
Similarly, does size represent the width of a cube in POV-Ray units?
2) As far as I can tell, POV-Ray uses the octree to store *points* in 3D
space (on the surface of objects) where the illuminance was sampled in
ra_gather(). All the octree tutorials I've read have the octree storing 3D
*objects*, not dimensionless points! I'm not
sure how to store a point in an octree. How does POV's octree select the
size of cube necessary to store a point? (which has no size)
Thanks for your help in getting me started :)
Sorry for posting in the wrong group initially!
George Pantazopoulos
Post a reply to this message
|
|
|
|
In article <3d8cb7ff$1@news.povray.org> , "George Pantazopoulos"
<the### [at] attbicom*KILLSPAM*> wrote:
> Hey all,
> I'm trying to wrap my mind around how POV-Ray uses the octree structure.
> I've
> done some reading on octrees, and have a decent mental picture of what they
> are (I've even drawn diagrams for myself). However, I am getting stuck in
> the
> following areas:
>
> 1) What exactly do the OT_ID (in octree.h) data items x,y,z, and size
> represent? Is x,y,z the the corner of the cube (node)? If so, which corner?
> Similarly, does size represent the width of a cube in POV-Ray units?
No, not really. I assume you saw the note at the top of octree.cpp? And
now you are confused about the "pow(2,size-127)"?
Well, basically the "pow(2,size-127)" is also the reason why the 3.5.0 and
earlier radiosity only works on IEEE 754 floating point number format
supporting platforms. So the size in essentially the mantissa of a floating
point number, which in turn is essentially the next lower power of two.
However, this number still has a bias of 127 because the code just takes the
signed value as unsigned value. What exactly happens can be found out in
ot_index_box.
> 2) As far as I can tell, POV-Ray uses the octree to store *points* in 3D
> space (on the surface of objects) where the illuminance was sampled in
> ra_gather(). All the octree tutorials I've read have the octree storing 3D
> *objects*, not dimensionless points! I'm not
> sure how to store a point in an octree. How does POV's octree select the
> size of cube necessary to store a point? (which has no size)
No, check out the functions ot_index_box and ot_ins. Their comments and
actions should be fairly clear...
Thorsten
____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trfde
Visit POV-Ray on the web: http://mac.povray.org
Post a reply to this message
|
|