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:
parent
a20902efd8
commit
51dde5296f
|
@ -367,7 +367,9 @@ namespace io {
|
||||||
|
|
||||||
static void ParseRotationMatrix(vcg::Matrix44f& m,const std::vector<QDomNode>& t)
|
static void ParseRotationMatrix(vcg::Matrix44f& m,const std::vector<QDomNode>& t)
|
||||||
{
|
{
|
||||||
|
vcg::Matrix44f rotTmp;
|
||||||
vcg::Matrix44f tmp;
|
vcg::Matrix44f tmp;
|
||||||
|
rotTmp.SetIdentity();
|
||||||
tmp.SetIdentity();
|
tmp.SetIdentity();
|
||||||
for(unsigned int ii = 0;ii < t.size();++ii)
|
for(unsigned int ii = 0;ii < t.size();++ii)
|
||||||
{
|
{
|
||||||
|
@ -375,10 +377,10 @@ namespace io {
|
||||||
QStringList rtl = rt.split(" ");
|
QStringList rtl = rt.split(" ");
|
||||||
if (rtl.last() == "") rtl.removeLast();
|
if (rtl.last() == "") rtl.removeLast();
|
||||||
assert(rtl.size() == 4);
|
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.SetRotateDeg(rtl.at(3).toFloat(),vcg::Point3f(rtl.at(0).toFloat(),rtl.at(1).toFloat(),rtl.at(2).toFloat()));
|
||||||
tmp *= tmp;
|
rotTmp = rotTmp*tmp;
|
||||||
}
|
}
|
||||||
m = m * tmp;
|
m = m * rotTmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void AddTranslation(vcg::Matrix44f& m,const QDomNode t)
|
static void AddTranslation(vcg::Matrix44f& m,const QDomNode t)
|
||||||
|
|
Loading…
Reference in New Issue