Can I rotate a bone with a Gizmo?

Hi. I’m new to babylonjs.
I want to rotate joints of a body model with a mouse.
It would be nice if gizmos are attached to the bone.
Is there any example for this?

I tried attached meshes to the bone (mesh.attchToBone) and tried to rotate the mesh with gizmos.
Then the mesh suddenly disappears. I knew this might not work, but I cannot come up with any workarounds. Any suggestions would be very helpful.

Welcome aboard!

Gizmos should work with bones: could you make a repro in the Playground (https://playground.babylonjs.com/) so that people can have a look?

I found out what is the problem.
I wanted to place the model in specific position.
So I moved only mesh, but not skeleton. Therefore, gizmo showed in the wrong place.
https://playground.babylonjs.com/#VZ2SPA#4

However, I couldn’t figure out how to translate the skeleton.
How can I correctly move both mesh and skeleton?

Pinging @Cedric

Let me check that.

Hi @Keunwoo_Park

If you translate only the mesh, it will be out of sync with the skeleton.
To translate both, you have to move the root bone.

See this PR : https://playground.babylonjs.com/#VZ2SPA#6

3 Likes

Thank you for your help!