Hi Yang, Translation operation isn't same as rotation operation. While one object is rotating in every transformation node by traversing the scene graph from parent to child, every node can effect the current rotation state to the target child node.
Distinctly in translation operation every node try to translate target child node to specified coordinate point which is every PAT node instantiate it with osg::Vec3(10.0f,10.0f,0.0f). Actually every PAT nodes effect the child node to locate it osg::Vec3(10.0f,10.0f,0.0f) but only last one is validate on this operation. Becase PAT4 is the last node before the child node. So you can't hope to accumulate traslation value as rotation value. I hope that I did't tell you wrong explanations. Ümit Uzun 2009/7/9 yang zhiyuan <yangzy...@gmail.com> > Hi: > I find something strange like this: > osg::Matrix _matrix; > osg::ref_prt<osg::MatrixTransform> PAT1 = new osg::MatrixTransform(); > _matrix.setTrans(osg::Vec3(10.0f,10.0f,0.0f)); > PAT1 ->setMatrix(_matrix); > osg::ref_prt<osg::MatrixTransform> PAT2 = new osg::MatrixTransform(); > PAT2 ->setMatrix(_matrix); > osg::ref_prt<osg::MatrixTransform> PAT3= new osg::MatrixTransform(); > PAT3 ->setMatrix(_matrix); > osg::ref_prt<osg::MatrixTransform> PAT4= new osg::MatrixTransform(); > PAT4 ->setMatrix(_matrix); > > PAT1->addChild(PAT2->get()); > PAT2->addChild(PAT3->get()); > PAT3->addChild(PAT4->get()); > > osg::Node* node = osgDB::readNodeFile("*.ive"); > PAT4->addChild(node); > > I think node's final position is (40,40,0),but the actual position in scene > is(10,10,0).Do I have to accumulate the four MatrixTransform manually? > > tim.yan > > > > > _______________________________________________ > osg-users mailing list > osg-users@lists.openscenegraph.org > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > >
_______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org