diff --git a/src/libcore/track.cpp b/src/libcore/track.cpp index dc4ac3ac..2ba9a658 100644 --- a/src/libcore/track.cpp +++ b/src/libcore/track.cpp @@ -1,6 +1,7 @@ #include #include #include +#include MTS_NAMESPACE_BEGIN @@ -354,13 +355,13 @@ void AnimatedTransform::appendTransform(Float time, const Transform &trafo) { Eigen::JacobiSVD svd(A, Eigen::ComputeFullU | Eigen::ComputeFullV); EMatrix U = svd.matrixU(), V = svd.matrixV(), S = svd.singularValues().asDiagonal(); - if (svd.singularValues().prod() < 0) { - S = -S; U = -U; - } - EMatrix Q = U*V.transpose(); EMatrix P = V*S*V.transpose(); + if (Q.determinant() < 0) { + Q = -Q; P = -P; + } + VectorTrack *translation = (VectorTrack *) m_tracks[0]; QuatTrack *rotation = (QuatTrack *) m_tracks[1]; VectorTrack *scaling = (VectorTrack *) m_tracks[2];