The scaling of a Gizmo (as opposed to a scaling Gizmo)

As I continue on with my IK rig / editor, I added a mesh to pose the root bone. It is the orange highlighted inverted T mesh. Had to make it a T, instead of just a vertical stick to make it easier to select.

Anyway, thought I would try to use a rotation gizmo to avoid UI sliders. It sort of works, but kind of huge. I am designing for WebXR, which is scaled in meters. The characters are less than 1.6 meters high.

I only found something to control the width, but not the size of the rings. Is this possible to make it smaller?

Another thing is the rings are always on the screen, which is not a problem in itself, but when I click to select another mesh, the rings jump to center around (0, 0, 0). Is this by design? I only have one gizmo, but seems you can have more. Wonder what happens when clicking with multiples.

adding @Cedric

Ok, I putting the mesh into attachableNodes instead of attachableMeshes. When I corrected that I no longer get the jump to (0,0,0), but now when initiating a drag when not over one of my IK / look controller meshes or the rings does not adjust the arc rotate camera. Mouse wheel zoom is also not functional.

Rings still very big. If it makes any difference, all the control meshes, including inverted T, are parented to the character. Making a PG is going to be more work than adding sliders for each rotation dimension. Maybe a guess? Might just have to abandon.

You can try to use something like:

gizmo.yGizmo._rootMesh.getChildren()[0].scaling.set(0.25,0.25,0.25)

https://www.babylonjs-playground.com/#31M2AP#125

Note that _rootMesh is public and not hidden, so it is legal to use it.

Note also that the fourth parameter of the constructor is the thickness of the torus (see PG).

1 Like

Seeing your code that directly instanced a gizmo & not the gizmo manager was instructive. The key for me was using this UtilityLayer. While this does change the size of the rings, they being on a different layer do no change after that.

This makes for odd situations when the camera moves. If you zoom out, the mesh gets smaller, but rings do not.

gizmo_far

The bigger problem is as soon as you click on a ring, and now even one of the controller meshes, it is like the arc rotate camera is un-attached. Since, this is just a tool for my own use, and I already have a small gui panel, I am just going to add 3 slider sections like I did for pole angle of IK bone controllers.

Thanks for your effort, though.