Hi Robert,
Is it not possible to do anything under the cover of darkness :-)
Well, not when it's in a public SVN server anyways... :-)
I requested the code from Adrian and he's kindly provided it this
morning so I've begun review of it. The code itself will serve as a
useful reference, but right now I plan to code up support myself. My
goals are tight integration with the core OSG and existing
intersection codes so the goals are somewhat different to what
Adrian's code are written for.
OK, this was what I wanted to do as well, and I agree that Adrian's code
is a bit far from that goal, which is why I waited so much to tackle
that task...
For reference, the strategy I used in my Masters was to have one kd-tree
per geode in the scene graph. This kd-tree would only need to be
recalculated when the drawables were modified, so when doing for example
dirtyBound() I would also call a method on the geode's kd-tree to
recalculate it (if this could be automatic it would be better of
course). When doing the intersection tests, I would first test the scene
graph's bounding volumes to find the intersections with geodes, then I
would transform the ray by the geode's inverse world transform, and then
I would test the geode's kd-tree. I think intersection with bounding
volumes is fast enough to be a good broad-phase test to eliminate many
candidates quickly.
Of course, this is slower than a kd-tree-only intersection test in
static scenes, but it has the advantage of requiring less kd-tree
rebuilds in the case of a dynamic scene (which was the whole premise of
my Masters). I was operating on the assumption that rebuilding the
kd-tree each frame would be too costly. I never tested that assumption
of course, but based it on previously published works.
So perhaps the kd-tree could have two strategies, one for static scenes
and one for dynamic ones. Perhaps this could be chosen based on the
graph nodes' data variance setting? Just thinking out loud.
I'll provided more info this work once I have something for others to
test out, right now osgkdtree does nothing useful.
What? Loading a scene is not useful? :-)
J-S
--
______________________________________________________
Jean-Sebastien Guay [EMAIL PROTECTED]
http://www.cm-labs.com/
http://whitestar02.webhop.org/
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org