Hello Carsten,
thank you for your reply. So I had to experiemtn with the methods
myself, and I guess I found the bug.
To me it seems as if Matrix::setTransformat applies the components
in the following order:
1. Scale
2. Rotate
3. Translate
But Matrix::getTransform returns components for the following order:
1. Rotate
2. Scale
3. Translate
I was able to work around this inconsistency by postprocessing the
values returned by getTransform as follows:
Matrix originalMatrix = {...};
Vec3f translation, scale;
Quaternion rotation, scaleOri;
originalMatrix.getTransform(translation, rotation, scale,
scaleOri, center);
Matrix rot;
rot.setTransform(osg::Vec3f(), rotation, osg::Vec3f(1,1,1),
osg::Quaternion(), center);
rot.invert();
originalMatrix.multLeft(rot);
Vec3f tmpTrans;
Quaternion tmpRot;
originalMatrix.getTransform(tmpTrans, tmpRot,
scale, scaleOri, center);
scaleOri.invert();
Then the variables translation, rotation, scale, scaleOri together
with center contain the correct values to be fed into
Matrix::setTransform such that the original Matrix is reconstructed.
Maybe this will help some other people, too. Of course the best
solution would be to fix the OpenSG matrix decomposition, such that
the correct values will be computed.
Regards,
Kaya
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users