Rotation gizmo location for custom mesh

Hi All-

I use baked (world) vertices for my custom meshes which makes using gizmos a little tricky.

What I want to do is have a rotation gizmo whose axis is the center of my mesh. This playground does this by setting the pivot of the mesh to be the center of the bounding box of the mesh and then attaching the gizmo to the mesh.

It works but the gizmo is located at (0,0,0), which makes sense since that’s the position of the mesh transform.

I imagine I can use a transform node to center the gizmo on the mesh but I can’t quite figure out how.

Any thoughts?



cc @Cedric

I would not do it using pivot but with a bake transform instead:

mesh is moved so its center is on (0,0,0), baked and then translated to move its center at the previous world position.

Thanks, Cedric. That makes sense.

I had tried that approach unsuccessfully in my app but I it works in the playground so I’ll go back and figure out why.

1 Like