[osg-users] Manage DOF nodes within LOD models.

2010-08-04 Thread Dario Minieri
Hi,

I wanted to ask if there is a best practice to manage DOF nodes in the LOD 
models. 

For example, I have a model with 2 level-of-detail with the same DOF nodes for 
each sub-detailed model. So, I have a root LOD node that has as childrens 2 
Group which are the two models with different levels of detail. 

Now, when I search a DOF node by name with a visitor, I find always the first 
DOF in the first model LOD hierarchy, obviously. So, if I'm viewing the first 
range I have no problems, but if I'm viewing the second I see no movement 
because the catched DOF is related to an unloaded model.

Then, I wondered if there is another smart form for models with LOD and DOF 
(maybe something can unify the DOF) or if I have to change the code to check 
what is the current displayed model and then catch the correct DOF.

Sorry for nub question. :D

Thank you!

Cheers,
Dario

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=30537#30537





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Manage DOF nodes within LOD models.

2010-08-04 Thread Paul Martz

Dario Minieri wrote:

Now, when I search a DOF node by name with a visitor, I find always the first 
DOF in the first model LOD hierarchy, obviously. So, if I'm viewing the first 
range I have no problems, but if I'm viewing the second I see no movement 
because the catched DOF is related to an unloaded model.


Assuming the scene graph structure isn't changing dynamically, you should only 
need to find the DOFTransform nodes once, at model load time. You should be 
able to easily modify your existing visitor to find both (not just one) of the 
Transforms.


After modifying the first Transform, copy it onto the second Transform. For a 
MatrixTransform, this is just a matrix copy. Not sure what you'd need to do to 
copy a DOFTransform; check the header.



Then, I wondered if there is another smart form for models with LOD and DOF (maybe 
something can unify the DOF) or if I have to change the code to check what is the 
current displayed model and then catch the correct DOF.


I think you always want to change both Transforms so that when you switch from 
one LOD to the other, both models are transformed the same.


--
  -Paul Martz  Skew Matrix Software
   http://www.skew-matrix.com/
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org