Maybe the viewer is automatically finding your model, so it "looks" like the model did not move.

Try adding the model twice, once with and once without transform. You should see two models separated.

jp

yang zhiyuan 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
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

--
This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html.

This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. MailScanner thanks Transtec Computers for their support.

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

Reply via email to