Hi Yang,

Nothing is wrong, you aren't see the translation because the Viewer's
fallback TrackballManipulator is initializing it's home view to the
center of the model.

Robert.

On Wed, Nov 26, 2008 at 2:09 PM, yang zhiyuan <[EMAIL PROTECTED]> wrote:
> Hi:
>      I try to transform osg::Node by MatrixTransform,but failed .Could
> anybody tell me what is the matter.
>
>    Here is my code:
>
>    osgViewer::Viewer viewer;
>     osg::Node* node = osgDB::readNodeFile("car/car.osg");
>
>      osg::Group* rootNode = new osg::Group;
>     osg::MatrixTransform* mt1=new osg::MatrixTransform;
>     mt1->setMatrix(osg::Matrix::translate(osg::Vec3(0.0,0.0f,2.0f)));
>     mt1->addChild(node);
>
>     rootNode->addChild(mt1);
>
>      viewer.setSceneData(rootNode);
>     viewer.realize();
>     viewer.run();
>
>
>
> another problem: can I add matrixtransform to another matrixtransfrom in
> order to get the total effect the two matrixtransforms?Should I use
> nodevisitor to implement this idea?
> _______________________________________________
> 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

Reply via email to