rotationGizmo the rotation results abnormally when the parent node scales the three axes unequally。

I think this problem is the problem of our project, but I can’t locate the reason, so I would like to ask which may cause the failure of clearCoat.

I really don’t know why clearcoat would not work… Do you have a live link which shows the problem?

I found that THE varnish works in THE version deployed on the Internet!! Can pull the version to locate the problem!

1 Like

Hello babylon, I have noticed that this problem has been modified on github and tested. I found this problem when only the parent of the mesh scales unevenly. Modified will updateGizmoRotationToMatchAttachedMesh = false, mesh itself rotation after a non-uniform scale can cause mesh scale was modified to uniform scale.
This is the test page, first change the ball to non-uniform scale and then rotate, the ball will be changed to uniform scale.
A Basic Scene | Babylon.js Playground (babylonjs.com)

Rotation does work for me in your Playground even after I have scaled the sphere in one direction:

Need more rotation Angle will appear problem, can use because the gizmo. Gizmos. RotationGizmo. UpdateGizmoRotationToMatchAttachedMesh = false, If the gizmo gizmos. RotationGizmo. UpdateGizmoRotationToMatchAttachedMesh = true will not be used.

I see! No idea why it’s doing that…

Summoning the king of Gizmo @Cedric, but be patient as it is vacation time these days.

@xiehangyun
Rotation with non uniform scaling is limited. instead of producing wrong orientation, it’s just disabled with a warning in the console.
This comes from the fact that it’s impossible to decompose properly a world matrix in that case with quaternion/scale/translation.
A solution would be to use translation/scale/rotation quaternion all along but it would be a nightmare and very, very bug prone when generalizing to Node and not only TransformNode.
Moreover, non uniform scaling and not a common case and adding a lot of potential bugs/back compatibility break for that case doesn’t seem like a win to me.
So, either set UpdateGizmoRotationToMatchAttachedMesh to the correct value or try to limit the potential to have non uniform scaling.

1 Like

Thank you for your recovery. I know, but previously it was only the parent node that caused the problem, but now the node itself has been disabled. And there is no problem with rotation first and then scaling, so is there another solution?

I would set the gizmo node to be the last one in hte hierarchy with uniform scaling.
Basically, transforming a non uniform scaling is not allowed depending on UpdateGizmoRotationToMatchAttachedMesh value.

Or, maybe even simpler, create a transform node at the absolute position of the node you want to transform and with the observables, set the rotation value of the node from that transient nodeTransform.
Basically, use a proxy transformNode.

1 Like

If the non-uniform scaling of the node itself (the parent node is uniformly scaled) can be rotated properly, then creating a proxy node in world coordinates can be a good solution。

1 Like