-
Notifications
You must be signed in to change notification settings - Fork 66
Fixing Nan errors in Camera Frustum Mesh #1397
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixing Nan errors in Camera Frustum Mesh #1397
Conversation
… point imprecision that caused this to try and calculate a new up vector. Because the up vector was being rotated based on that floating point imprecision, it was trying to rotate around a (0,0,0) axis which caused nan values
@emily-howell can we add a test that exercises one of these cases? Worried about the divide + mult impact on other cases. Is it a case where the look at and position are very clost? Is it possible to fix this before the normalize? |
For sure. Let me put together some test cases for this |
…024_investigate-nans-in-camera-frustrum-mesh
@cyrush To answer your above questions:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, thanks!
// If the look vector has been rotated by a certain angle, ajust the camera up vector to match | ||
if (angle_between != 0.0) { | ||
// If the look vector has been rotated by a certain angle, adjust the camera up vector to match | ||
if (vtkm::Abs(angle_between) >= 0.001) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, this looks like a robust approach.
Thanks @emily-howell ! |
Issue was that when normalized, the look vector had a slight floating point imprecision that caused this to try and calculate a new up vector. Because the up vector was being rotated based on that floating point imprecision, it was trying to rotate around a (0,0,0) axis which caused nan values