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

GLTFLoader: Use a smaller bounding box for morph targets #18907

Merged
merged 1 commit into from
Mar 18, 2020
Merged

GLTFLoader: Use a smaller bounding box for morph targets #18907

merged 1 commit into from
Mar 18, 2020

Conversation

zeux
Copy link
Contributor

@zeux zeux commented Mar 16, 2020

Instead of assuming a worst case when the weight of each target is +-1,
assume that the sum of the weights is +-1 instead.

This isn't quite correct and may result in a bounding box that's too
small, but in at least one case - when morph targets are used for
keyframe animations and only two are active at a time - this results in
a much smaller bounding box.

In some other more realistic cases this may also reduce the bounding box
without a real impact on it being conservative, e.g. it's common to have
50 blend shapes for facial animations but only a few are active at a
time, and extreme deformations are typically contained within a box
that's computed with the new algorithm as well.

Fixes #18809.

Instead of assuming a worst case when the weight of each target is +-1,
assume that the sum of the weights is +-1 instead.

This isn't quite correct and may result in a bounding box that's too
small, but in at least one case - when morph targets are used for
keyframe animations and only two are active at a time - this results in
a much smaller bounding box.

In some other more realistic cases this may also reduce the bounding box
without a real impact on it being conservative, e.g. it's common to have
50 blend shapes for facial animations but only a few are active at a
time, and extreme deformations are typically contained within a box
that's computed with the new algorithm as well.

Fixes #18809.
Copy link
Collaborator

@donmccurdy donmccurdy left a comment

Choose a reason for hiding this comment

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

Thank you!

@mrdoob mrdoob added this to the r115 milestone Mar 18, 2020
@mrdoob mrdoob merged commit 2480ed0 into mrdoob:dev Mar 18, 2020
@mrdoob
Copy link
Owner

mrdoob commented Mar 18, 2020

Thanks!

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.

GLTFLoader: Very large bounding box w/ morph targets
4 participants