Hi there, 

This might be a load of rubbish and not possible mathematically, but I'm trying 
to decompose a matrix and apply it to an osg::PositionAttitudeTransform in 
order to set the PAT by matrix. 

The reasoning behind this is I am using PAT to give a human friendly position, 
rotation, scale for objects in a CAD-style application, but in certain 
circumstances, I would like to apply a matrix directly to the PAT and say 
"That's your matrix, use that". 

I have tried this


Code:

osg::Vec3 position = matrix.getTrans();
osg::Vec3 scale = matrix.getScale();
osg::Quat rotation = matrix.getRotate();

this->positionAttitude->setPosition(position);
this->positionAttitude->setScale(scale);
this->positionAttitude->setAttitude(rotation);




and it gives odd results. Also I was looking at matrix.decompose but I'm not 
sure what to do with "Scale Orientation". 

can anyone put me out of my matrix misery!?

Thank you!

Cheers,
Andrew

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=18301#18301





_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to