Hi All,
I have an model composing of different part of component in .3ds format. I
am trying to traverse in these part of component and translate them. As like
as
http://www.openscenegraph.org/projects/osg/wiki/Support/Tutorials/FindingNodessample'
I want to control part of component with findnodevisitor but I don't
know how can I translate them.
for example in FindingNode sample translating is doing with
if (turretDOF)
{
turretDOF->setCurrentHPR( osg::Vec3(-3.14159/4.0,0.0,0.0) );
}
This t72-tank.flt model's turret component is osgSim::DOFTransform format
and it could translated with setCurrentHPR command, but my components is not
in this format.
I can get a Geode node from model. The abstract osg model is below;
------------------------------------------------------------------------------------------------------
Group {
name "GL_6000_v22.3DS"
nodeMask 0xffffffff
cullingActive TRUE
num_children 7
MatrixTransform {
name "3DSPIVOTPOINT: Rotate"
nodeMask 0xffffffff
cullingActive TRUE
referenceFrame RELATIVE
Matrix {
-1 -0 -0 -0
-0 1 -3.25841e-007 -0
-0 3.25841e-007 1 -0
0 -1.65228e-008 0.377998 1
}
num_children 1
MatrixTransform {
name "3DSPIVOTPOINT: Translate pivotpoint to (world) origin"
nodeMask 0xffffffff
cullingActive TRUE
referenceFrame RELATIVE
Matrix {
1 0 0 0
0 1 0 0
0 0 1 0
9.33344 2.61793e-006 -6.68031 1
}
num_children 1
Geode {
name "1_planetar"
nodeMask 0xffffffff
cullingActive TRUE
num_drawables 5
Geometry {
DataVariance STATIC
StateSet {
DataVariance STATIC
rendering_hint DEFAULT_BIN
renderBinMode INHERIT
Material {
name "Material #5"
ColorMode OFF
ambientColor 0.176471 0.176471 0.176471 1
diffuseColor 0.176471 0.176471 0.176471 1
specularColor 0.431059 0.431059 0.431059 0.48
emissionColor 0 0 0 1
shininess 16.64
}
}
....
....
.....
etc.
------------------------------------------------------------------------------------------------------
How should I do for translating or rotating part of components of model like
turret or gun movement at Tank sample code? And Should I get Geode node or
Geometry node? Which one should I handle?
Thanks so much,
Best Regards.
ümit Uzun
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org