Hi Miroslav, I'm not sure where to start as I'm not sure what level of understanding about the coordinate systems in play, it does look like you are missing a few things as your transform certainly isn't relevent to a Earth Center Earth Fixed (ECEF) coordinate system like osgEarth sets up typically.
The best I can do is recommend you read up on the web about ECEF, and have a look at the osgsimulation example as it places a loaded model around a ECEF globe. Robert. On Mon, Aug 24, 2009 at 8:20 AM, miroslav karpis<[email protected]> wrote: > 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 > _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

