davideberly / GeometricTools

A collection of source code for computing in the fields of mathematics, geometry, graphics, image analysis and physics.
Boost Software License 1.0
1.08k stars 202 forks source link

is a bug? #77

Closed WuyangPeng closed 7 months ago

WuyangPeng commented 7 months ago

ViewVolume.cpp void ViewVolume::SetAxes(Vector4 const& dVector, Vector4 const& uVector, Vector4 const& rVector)

if (std::fabs(1.0f - det) > epsilon)

I think is if (1.0f - std::fabs(det) > epsilon) det maybe -1

davideberly commented 7 months ago

I know you closed the issue. For completeness, the camera direction vectors must form a right-handed orthonormal basis. That is, the vectors D, U, and R must be unit length and mutually perpendicular. For right-handedness, if you were to create a rotation matrix whose columns are D, U, and R, the determinant must be +1 (a determinant of -1 makes the matrix a reflection). So in the code, 'det' must be close to 1. The test 'std::fabs(1.0f-det) > epsilon' says that the determinant is not close to 1.

Thank you for the feedback!