Corrected the broken ParseRotationMatrix. It had two bugs: it did not correctly parsed sequence of rotations and it exchanged degree with radians

This commit is contained in:
Paolo Cignoni 2008-07-13 05:39:13 +00:00
parent a20902efd8
commit 51dde5296f
1 changed files with 5 additions and 3 deletions

View File

@ -367,7 +367,9 @@ namespace io {
static void ParseRotationMatrix(vcg::Matrix44f& m,const std::vector<QDomNode>& t)
{
vcg::Matrix44f rotTmp;
vcg::Matrix44f tmp;
rotTmp.SetIdentity();
tmp.SetIdentity();
for(unsigned int ii = 0;ii < t.size();++ii)
{
@ -375,10 +377,10 @@ namespace io {
QStringList rtl = rt.split(" ");
if (rtl.last() == "") rtl.removeLast();
assert(rtl.size() == 4);
tmp.SetRotate(rtl.at(3).toFloat(),vcg::Point3f(rtl.at(0).toFloat(),rtl.at(1).toFloat(),rtl.at(2).toFloat()));
tmp *= tmp;
tmp.SetRotateDeg(rtl.at(3).toFloat(),vcg::Point3f(rtl.at(0).toFloat(),rtl.at(1).toFloat(),rtl.at(2).toFloat()));
rotTmp = rotTmp*tmp;
}
m = m * tmp;
m = m * rotTmp;
}
static void AddTranslation(vcg::Matrix44f& m,const QDomNode t)