The gizmo show wrong

Capture9900

i use the gizmo to rotate the mesh,disabled some axis,
as you saw,the circle is x-axis of rotation,but when i rotate,the plane showed looks like other axis(not x-axis)

    disableSingleAxis(gizmoType: string, axes: Array<string>) {
        ['x', 'y', 'z'].forEach((it: string) => {
          this.instance.gizmos[gizmoType + 'Gizmo'][it + 'Gizmo'].isEnabled = true
        })
        axes.forEach((it: string) => {
          this.instance.gizmos[gizmoType + 'Gizmo'][it + 'Gizmo'].isEnabled = false
        })
    }

Hi @ecojust

Can you please provide a playground so I can test it?

maybe it is hard to creat a playground,
but it seems triggers other axis’s dragEvent.
when i open other axis and only rotate x-axis,that’s true
but,why?i disabled others:

    *.isEnabled = false

I tried to do a PG to repro your issue…without success

rotation plan issue | Babylon.js Playground

Can you please modify it to show your issue?

@Cedric That’s very kind of you,thanks.

I modify it with my project’s way,it doesn’t cause the issue.
It may be the subsequent business logic that causes the problem,i am debuging it,I will update my progress later

https://playground.babylonjs.com/#3DQ85I#1

@Cedric I reproduced the question in this PG

https://playground.babylonjs.com/#3DQ85I#2

screenshots:

I think I understand what’s happening now. Let me try to find a fix …

I try to avoid changing the attribute of the mesh in both ways,that would really solve my problem.

But i think:if it is a bug?

or if we can update the gizmo’s behavior after set the attribute of the mesh by hand

gizmo's operation...

set the attribute of the mesh by hand...

update the gizmo...

and,I haven’t found a way to update Gizmo yet

The issue I found is the mesh rotation is changed while using the gizmo. It’s a edge case. If while dragging the gizmo, no modification happens, it should be fine.

In fact,in my case,i set the attribute after draged;

onDragEndObservable.add(_=>{
    setAttribute...
})

not in the process of dragging.

there are 5 points,i drag a point by gizmo,so i need calculate the interpolation of others according to the offset (10deg),
after that,i get the new offsets:

  0deg,5deg,10deg,5deg,0deg

then,i apply them by hand again

for(var i =0;i<5;i++){
    var point = points[i];
    if(point != currentGizmoPoint){
        point.rotation = new BABYLON.Vector3();
        point.addRotation(0,0,point.offsetRotation)
    }
}

now,I circumvented the problem with a judgment

I wonder if there is another way, or if this is a bug that can be fixed

It’s not what I was thinking. Can you please record a video? If you add rotation to the meshes that are not linked to a gizmo, it should not desync the display plane.

you are right!
so,i use a judgment to skip the mesh that are linked to the gizmo

if(point != currentGizmoPoint){
    point.rotation = new BABYLON.Vector3();
    point.addRotation(0,0,point.offsetRotation)
}