three.js icon indicating copy to clipboard operation
three.js copied to clipboard

Always select 3d models with bones and animation.

Open quangtri3111996 opened this issue 1 year ago • 13 comments

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

  1. Create a scene with models and a model with bones and animation.
  2. Click on any a model in the scene, it always selects to the model with bones and animation
  3. Create a scene with models and a model without bones and animation.
  4. 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

quangtri3111996 avatar Apr 17 '23 02:04 quangtri3111996

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.

donmccurdy avatar Apr 17 '23 03:04 donmccurdy

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 avatar Apr 17 '23 04:04 quangtri3111996

@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 avatar Apr 17 '23 14:04 donmccurdy

@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

quangtri3111996 avatar Apr 17 '23 14:04 quangtri3111996

Hello @donmccurdy, any new update on this?

quangtri3111996 avatar Apr 20 '23 03:04 quangtri3111996

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

donmccurdy avatar Apr 23 '23 14:04 donmccurdy

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 avatar Apr 25 '23 02:04 quangtri3111996

@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 avatar Apr 25 '23 03:04 donmccurdy

@donmccurdy, thanks for supporting, Hope to solve it in the near future.

quangtri3111996 avatar Apr 25 '23 07:04 quangtri3111996

@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

Mugen87 avatar Apr 25 '23 08:04 Mugen87

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.

Mugen87 avatar Apr 25 '23 09:04 Mugen87

Hello @Mugen87 and @donmccurdy any update on this?

quangtri3111996 avatar May 29 '23 10:05 quangtri3111996

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.

Capture-picker

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.

AlaricBaraou avatar Jan 30 '24 10:01 AlaricBaraou