[osg-users] Using Kd-tree for spatial data
aluaces at udc.es
Fri Sep 5 02:13:28 PDT 2008
you could also try to use osgUtil::Optimizer with the SPATIALIZE_GROUPS flag
set. This way, the scenegraph will be laid like an octree, so it would
roughly act as the kd-tree between the root and the leaves.
I don't know of any program to do what you want, but maybe you could collapse
all the geometry into one big geode and then run the kdtree builder visitor
on it. To do so, you would use the optimizer with the MERGE_GEODES flag.
El Viernes 05 Septiembre 2008ES 10:33:39 maruti borker escribió:
> Hi ,
> I understood your point. That is why i said that the kd-tree
> implemented in OSG wont be useful for my purpose. I just wanted to know if
> there are any tools/code which creates a single kd-tree of the whole scene.
> Maruti Borker
> IIIT Hyderabad
> Website:- http://students.iiit.ac.in/~maruti
> Blog:- http://marutiborker.wordpress.com
> On Fri, Sep 5, 2008 at 1:52 PM, Robert Osfield
<robert.osfield at gmail.com>wrote:
> > HI Maruti,
> > On Fri, Sep 5, 2008 at 9:11 AM, maruti borker <slimshadymaruti at gmail.com>
> > wrote:
> > > But when i went through the discussion, i found out that only geomety
> > > in
> > the
> > > leaves have seperate kd-tree and not a single kd-tree for the whole
> > scene.
> > > Correct me if i am wrong.
> > The use of KdTree on drawable leaves only is done to provide a good
> > balance between efficiency of intersection test and flexibility. For
> > instance the system we have now handles whole scene with moving parts,
> > if you had a single KdTree you'd need to recompute it all the time.
> > Also a well balanced scene graph will be spatially distributed so will
> > the hierarchical bounding volumes that help intersection tests.
> > Jumping to KdTree for the whole scene graph is technically possible,
> > but you'll need to build the KdTree yourself, and in terms of
> > performance vs flexibility tradeoff's is not good, it's a lot of
> > effort for little gain in performance.
> > Robert.
> > _______________________________________________
> > osg-users mailing list
> > osg-users at lists.openscenegraph.org
> > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
More information about the osg-users