Thomas Maier schrieb: > Hi, > it seemed that all translations/transformations are done with a PAT, but when > i rotate the PAT object which does not sit at position 0,0,0 of the > "world-coordinates", but it rotates around the world-coordinate-axis, but i > want to rotate around a axis of the object itself? > > I tried code like the following, but it always turns around > "world-coordinate-axis". > > pos->set(rectangleTwoXForm->getPosition().x(), > rectangleTwoXForm->getPosition().y()+1, rectangleTwoXForm->getPosition().z()); > > //rectangleTwoXForm->getPosition().set(rectangleTwoXForm->getPosition().x(), > rectangleTwoXForm->getPosition().y(), rectangleTwoXForm->getPosition().z() ); > > rectangleTwoXForm->setAttitude(osg::Quat(osg::DegreesToRadians(i), *pos ) ); > > Hi,
you´ll need to compose your transform: First do a translation that brings your axis to the origin, then rotate, then translate back. Regards, Andreas _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

