diff --git a/src/shapes/disk.cpp b/src/shapes/disk.cpp index 7d575ebc..922f8e83 100644 --- a/src/shapes/disk.cpp +++ b/src/shapes/disk.cpp @@ -105,7 +105,7 @@ public: Vector dpdu = trafo(Vector(1, 0, 0)); Vector dpdv = trafo(Vector(0, 1, 0)); - if (std::abs(dot(dpdu, dpdv)) > 1e-3f) + if (std::abs(dot(normalize(dpdu), normalize(dpdv))) > 1e-3f) Log(EError, "Error: 'toWorld' transformation contains shear!"); if (std::abs(dpdu.length() / dpdv.length() - 1) > 1e-3f) diff --git a/src/shapes/rectangle.cpp b/src/shapes/rectangle.cpp index 2be94648..694d136d 100644 --- a/src/shapes/rectangle.cpp +++ b/src/shapes/rectangle.cpp @@ -105,7 +105,7 @@ public: m_frame = Frame(normalize(m_dpdu), normalize(m_dpdv), normal); m_invSurfaceArea = 1.0f / getSurfaceArea(); - if (std::abs(dot(m_dpdu, m_dpdv)) > Epsilon) + if (std::abs(dot(normalize(m_dpdu), normalize(m_dpdv))) > Epsilon) Log(EError, "Error: 'toWorld' transformation contains shear!"); }