Re: [osg-users] How to get position of sub-drawable object from PositionAttitudeTransform

2011-05-17 Thread Nan WANG
anybody knows that?

using
osg::Node* findNamedNode(const std::string searchName, osg::Node* currNode)?


Thank you!

Cheers,
Nan

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





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


[osg-users] How to get position of sub-drawable object from PositionAttitudeTransform

2011-05-16 Thread Nan WANG
Hello

I am wondering how to get position of sub drawable object from 
PositionAttitudeTransform.

Two objects are created with osg::Cylinder and osg::Sphere, the I created two 
osg::ShaperDrawable...then declare an instance of geode class and attached tow 
Drawables to it, finally, added 'basicShapesGeode' as a child of PAT


Code:

osg::Cylinder* unitCylinder = new osg::Cylinder( osg::Vec3(0,50,0), 
0.6f,100.0f);
osg::Sphere* pointing = new osg::Sphere(osg::Vec3(0,100,0),1.0f);

osg::ShapeDrawable* unitCylinderDrawable = new 
osg::ShapeDrawable(unitCylinder);
osg::ShapeDrawable* unitSphere = new osg::ShapeDrawable(pointing);

// Declare a instance of the geode class: 
osg::Geode* basicShapesGeode = new osg::Geode();
// Add the unit cube drawable to the geode:
basicShapesGeode-addDrawable(unitCylinderDrawable);
basicShapesGeode-addDrawable(unitSphere);

osg::PositionAttitudeTransform* handMat = new 
osg::PositionAttitudeTransform;
handMat-addChild(basicShapesGeode);
handMat-setScale(Vec3(0.01,0.01,0.01));

root-addChild(handMat);




Can anybody tell me how the get the position of osg::Cylinder or osg::Sphere 
from PAT?
... 

Thank you!

Cheers,
Nan

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





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