Hi,

please can you help me with this? I have a node globe (from osgEarth). All I 
want now is add a new model (for example helicopter) and place it on top of the 
surface of the globe and set camera so that it points like from the helicopter 
model.....

I have tried MatrixTransfrom, but most probably am not using it right...

Here is what I made until now..(I'm not able to see both nodes together. only 
globe, or helicopter...)


Code:

osg::Group* root = new osg::Group();
osg::ref_ptr<osg::Node> globe = 
osgDB::readNodeFile("multiple_heightfields.earth");
osg::ref_ptr<osg::Node> heliNode = osgDB::readNodeFile("CH-146 Griffon.flt");

osg::MatrixTransform* mNavTrans = new osg::MatrixTransform();

root->addChild(globe.get());
root->addChild(mNavTrans);

double s = 100.0;

osg::Quat rotation;
osg::MatrixTransform* mModelTrans = new osg::MatrixTransform();
mModelTrans->preMult(osg::Matrix::rotate(-90.0f, 1.0f, 0.0f, 40.0f));
mModelTrans->setMatrix(osg::Matrixd::scale(s,s,s));// I have tried only with 
scale but it didn't work

mModelTrans->addChild(heliNode.get());
mNavTrans->addChild(mModelTrans);

osgUtil::Optimizer optimizer;
optimizer.optimize(root);





Thank you!

Cheers,
miroslav[code]

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





_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to