Bug with gizmo after setpivotmatrix function

Hi everybody,

Here’s my PG : Babylon.js Playground

I want the origin of my box to be the left front angle of the box. But if i want to move the box with the translation gizmo, there are 2 bugs :

  • the gizmo is not set at the origin of the box
  • the translation is totally erratic

Anyone can help me ?

Thanks in advance,

Boris

I would advise to not use the legacy mode (false in second param of setPivotPoint) it might be the unsupported mode for gizmo and cedric might look into it but not sure of the outcome.

Using the other mode would move the origing for scaling and rotating without inducing a translation. It also does not break gizmo https://playground.babylonjs.com/#53G1ES#1 you can uncomment the bottom part to see it.

If you wish to fully remap the origin (not only a pivot). I would advice to add a parent transform and if you can bake it, rely on bakeCurrentTransformIntoVertices… https://playground.babylonjs.com/#53G1ES#2

1 Like

What @sebavan said. I’ll take a look at the setPivotMatrix thing in the coming days.

1 Like

Thanks a lot…

I’m looking at the setPivotPoint issue now. As a work around, you can change the anchor point like this:

And there is a fix!

1 Like

You’re my hero !!! :heart_eyes:

2 Likes