three.js
three.js copied to clipboard
Always select 3d models with bones and animation.
Description
In a scene consisting of 3d model with bones and animation, when I select another 3d model in that scene, it always selects the 3d model with bones and animation. But when I try a scene with the model without bones and animation, this problem doesn't happen. Watch the video the phone is a 3d model without bones and the cheetah is a 3d model with bones and animation.
(Please watch the video: https://drive.google.com/file/d/1DPkdwFU8fxpJ2upq7JLaToFyYSoUZpY4/view?usp=sharing)
Reproduction steps
- Create a scene with models and a model with bones and animation.
- Click on any a model in the scene, it always selects to the model with bones and animation
- Create a scene with models and a model without bones and animation.
- This issue doesn't appear with the 3d model without bones
Code
No code example
Live example
https://drive.google.com/file/d/1DPkdwFU8fxpJ2upq7JLaToFyYSoUZpY4/view?usp=sharing
Screenshots
No response
Version
r151
Device
No response
Browser
Chrome
OS
No response
Hi @quangtri3111996! We cannot investigate this issue without information requested in the bug report form. Could you provide the model or a live demo (with code), rather than a video? It's possible this might be fixed by https://github.com/mrdoob/three.js/pull/25791, but without the information required, it won't be possible for us to find out.
Hi @donmccurdy, thanks for the reply. Please see the video (https://drive.google.com/file/d/1rErzPcGk3dY_bWYVW1JN2N3tjabEQxTe/view?usp=sharing)
- I am using https://threejs.org/editor/
- I have a 3d room. First, I can select new newspapers on the table, on the chair. But then I add a 3d model (a jaguar) have bones and animation, I can't select any models are close the jaguar model. When I click on the new papers or the chair, it always select to the jaguar.
@quangtri3111996 sorry, what's missing is a way for me to recreate the problem on my own computer. I cannot debug the video, we will need access to the 3D models you're loading. GitHub comments should allow you to attach .ZIP files if that's OK.
@donmccurdy, ooo so sorry, I didn't send you the 3D models.
Please use https://threejs.org/editor/ with 2 3d models
Thanks @donmccurdy 3d-models-test.zip
Hello @donmccurdy, any new update on this?
It seems that there are still some issues with bounds, raycasting, and frustum culling against skinned meshes on the dev
branch. Frustum culling isn't correct either here:
https://user-images.githubusercontent.com/1848368/233844805-1d85d34d-d6c9-48bd-9395-0dcbb6b91c7f.mov
Hi @donmccurdy , thanks for your answer, but I still not clear how to solve my problem. Again, I can select any pattern in the room on the viewport when I don't add the jaguar model. But when I add the jaguar model and I select the models that are close to the jaguar model, it always focuses on the jaguar model
@quangtri3111996 Sorry, I do not have a solution to your problem right now. Raycasting against THREE.SkinnedMesh has been buggy for a while. This is something we want to fix, but it will take some time.
@donmccurdy, thanks for supporting, Hope to solve it in the near future.
@donmccurdy I think the problem demonstrated in your video happens because one of the bones (the root joint) has been transformed which means the previously calculated bounding volume does not match anymore. I've tried to made the issue more clear in the following video:
https://user-images.githubusercontent.com/12612165/234227679-18c1b546-854c-443f-ae6b-187528b6b86e.mov
The editor allows to select bones over the skeleton helper which is probably something that should not be allowed.
Independently, the first click was outside the group's (yellow) bounding box and it was still possible to raycast the skeleton helper. This also needs to be investigated.
Hello @Mugen87 and @donmccurdy any update on this?
Hello @Mugen87 @donmccurdy I'm pretty sure the issue come from the "picker" that is automatically added to each object that use a helper.
You can see it in red in my screenshot, the area match the clicked elements in the video of the bug report.
I'm not sure why this picker is nescessary since the lines of each helper can be raycasted against as well as the skinnedMesh itself.
I found this PR #23617 by @mrdoob that seems to use the picker for a use case that I don't understand.
I'd be more than happy to make a PR to improve this, if someone could give me the use cases of that picker in order to come up with a solution that don't cause any regression.