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 precision of surface3d worldPosition calculation #21

Merged

Conversation

hborchardt
Copy link
Contributor

When the objectOffset is very large compared to the values in the localCoordinate, adding it to the localCoordinate loses precision in the localCoordinate. As the addition of the objectOffset was immediately undone by application of the model matrix, it is better to combine the model matrix and the translation by the objectOffset into one matrix and apply it directly to the localCoordinate.

See plotly/plotly.js#6999

When the objectOffset is very large compared to the values in the
localCoordinate, adding it to the localCoordinate loses precision in the
localCoordinate. As the addition of the objectOffset was immediately
undone by application of the model matrix, it is better to combine the
model matrix and the translation by the objectOffset into one matrix and
apply it directly to the localCoordinate.
@archmoj
Copy link
Contributor

archmoj commented May 16, 2024

Thanks very much for the PR.
💃

@archmoj archmoj merged commit 4f7404e into gl-vis:master May 16, 2024
@archmoj
Copy link
Contributor

archmoj commented May 16, 2024

Published gl-surface3d@1.6.2

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.

2 participants