Skip to content
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

Improve accuracy of 3D rotation #1466

Merged
merged 1 commit into from
Nov 15, 2019
Merged

Conversation

mzient
Copy link
Contributor

@mzient mzient commented Nov 15, 2019

Signed-off-by: Michal Zientkiewicz michalz@nvidia.com

Why we need this PR?

Pick one

  • It fixes accurancy problem when calculating 3D rotation matrix on ARM

What happened in this PR?

  • Replace axis::normalized with division by length (more accurate than using fast inverse square root)
  • Add special case when only one component of the axis is nonzero (avoid division altogether and force the nonzero coordinate to 1 or -1).

JIRA TASK: [DALI-XXXX]

Signed-off-by: Michal Zientkiewicz <michalz@nvidia.com>
@dali-automaton
Copy link
Collaborator

CI MESSAGE: [992407]: BUILD STARTED

@mzient mzient changed the title Improve accuracy of 3D rotation (hopefully) Improve accuracy of 3D rotation Nov 15, 2019
for (int i = 0; i < 3; i++)
axis[i] = axis[i] < 0 ? -1 : axis[i] > 0 ? 1 : 0;
} else {
// axis = axis.normalized();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can remove

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [992407]: BUILD PASSED

@mzient mzient merged commit 359c84a into NVIDIA:master Nov 15, 2019
@mzient mzient deleted the FixRotation3DAccuracy branch November 15, 2019 14:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants