Hi,

El Martes, 6 de Marzo de 2007 19:18, N. Farr escribió:
> My understanding of PAT's is that they are groupings inside which all
> objects are in a separate coordinate system different from the rest of the
> scene. Should the PAT be placed at the root's (0, 0, 0), then its separate
> coordinate system coincides with the world coordinate system, but if it
> were to be moved around the scene using setPosition(), then the two
> coordinate systems diverge. Despite this divergence, objects inside the PAT
> will maintain their absolute coordinates, so an object that has
> position (x, y, z) inside the PAT will maintain that position no matter
> where we place the PAT itself. Is this correct? If so, is there a function
> in OSG that can return an object's position inside the PAT in world
> coordinates, not PAT coordinates? Finally, I would assume that what applies
> to position applies to rotation, is that correct?

PAT nodes doesn't group anything, just transform the coordinates of the node 
or nodes hanging from it. Nodes by themselves haven't got a position or 
orientation, this is "inherited" from their "PAT" parents. So if you wanted 
to do what you said, a local frame where the objects are translated or 
rotated from it, you would have to chain at least two PATs: one for the 
mobile coordinate system and other PAT child to transform the object within 
it.

world -> PAT (coordinate system) -> PAT (relative pos/orientation) -> object

If you want to transform a coordinate from some node's local system to world 
coordinates or vice versa, you can use something like 
osg::Node::getWorldMatrices() to get the chain of transformations applied to 
that node.

HTH,

Alberto
_______________________________________________
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to