-
Notifications
You must be signed in to change notification settings - Fork 824
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
Bounding box for quantized models computed incorrectly? #2450
Comments
Yup, thanks for report looking into it
…On Wed, Jun 2, 2021 at 8:38 AM Don McCurdy ***@***.***> wrote:
Description
In three.js r128 a fix was added to compute the correct bounding boxes for
quantized models (mrdoob/three.js#21554
<mrdoob/three.js#21554>). That fix is working in
my viewer now (https://gltf-viewer.donmccurdy.com/) but for some reason
the latest version of model-viewer still does not center models using
quantized position attributes.
The effect of the incorrect bounding box is that the model is not visible
at all.
Live Demo
export-v1.glb.zip
<https://github.com/google/model-viewer/files/6585763/export-v1.glb.zip>
Compare:
- https://modelviewer.dev/editor/ (nothing shown)
- https://gltf-viewer.donmccurdy.com/ (correct)
- https://sandbox.babylonjs.com/ (correct)
Version
- model-viewer: v1.7.2
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#2450>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABZY3MUY5W3GZXQD3FHWXJ3TQZF7TANCNFSM4567ZTTQ>
.
|
* Fixes issue with framing a quantized GLTF fixes #2450 * removed normalized check
I'm seeing a very similar issue with models using skinning: The archive has a
|
In fact we do use our own function: https://github.com/google/model-viewer/blob/master/packages/model-viewer/src/three-components/ModelUtils.ts#L60, so that we can also compute a bounding frustum. I've been meaning to contribute this back to three.js, but haven't gotten around to it. Do you have any thoughts on the right way to fix this? |
@donmccurdy So, we recently fixed the issue with skinned meshes and their bind poses and your original model works just fine, but both of your CesiumMan models in your zip still fail. I don't really understand why: even without quantization, I'm getting bone transforms with huge weights (like 22) that send the vertices way off and I end up with a bounding box hundreds of meters on a side. I'm trying to upstream my bounding function (since three.js doesn't have a good way to calculate skinned mesh bounds at all right now), but I'd like to make sure I'm doing it right. I'm also curious if the quantization scaling should be applied before or after the bone transforms? I can't check with these models, because they don't work even when the scale is 1. |
@donmccurdy Upon further inspection, it appears your version of CesiumMan is an invalid glTF (since fixed in the repo), as it has bone weights of Interestingly, it also doesn't fail the validator. On the other hand, it seems three.js normalizes the weights in its shaders, but not in its CPU code, hence the bug. Perhaps that should be fixed regardless? |
This is mostly fixed and we have some similar open issues anyway. |
Description
In three.js r128 a fix was added to compute the correct bounding boxes for quantized models (mrdoob/three.js#21554). That fix is working in my viewer now (https://gltf-viewer.donmccurdy.com/) but for some reason the latest version of model-viewer still does not center models using quantized position attributes.
The effect of the incorrect bounding box is that the model is not visible at all.
Live Demo
export-v1.glb.zip
Compare:
Version
The text was updated successfully, but these errors were encountered: