AxisDragGizmo can not align local origin of attched mesh which has been setPivotMatrix!

I need to custom direction of aixs drag gizmo, built in AxisDragGizmo class is a grood way to do it. But there are still some little problem in my work. Due to the extrusion mesh has been setPivotMatrix,
the gizmo object cannot align local origin of the mesh;
https://playground.babylonjs.com/#SKHBQT#55

Than I plan to setCustomMesh for axis gizmo, I build an arrow mesh by merging a tube and
a cone, but when I set it as custom mesh for the axis gizmo. the color changed to white and I can not drag object with it.
https://playground.babylonjs.com/#SKHBQT#98

That’s a question for the master of Gizmos, @Cedric!

If I understand correctly your need, you want the gizmo (and the sphere) to be centered on the extruded mesh.
The easiest way, is to translate the vertices without touching the matrices (offset, world). that wa, the mesh is centered around 0 instead of starting a y = 0

https://playground.babylonjs.com/#SKHBQT#100

Check line 51

Let me know if it solves your issue :slight_smile:

2 Likes

Great, It is exactly what I want ! Thank for your help!

1 Like