setPivotPoint seems to ignore z?

Fixing some bad art (inconsistent local origins) at load time, trying to move the center of rotation to the model’s logical center instead of the back left corner that the artist used. I have a test rotation on Y to visually confirm current pivot point.

setPivotPoint() successfully offsets X in the expected way but does nothing in Z.

Why would this be? Ive gone over and over the Pivots and Parents doc page with no luck.

Note the vertical green Y axis marker

Natural origin, effectively no change - sanity check, origin remains at back left of model as expected
root.setPivotPoint( new Vector3( -0, 0, 0 ) )

Moving X, also works as expected - local origin is now back-center instead of back-left:
root.setPivotPoint( new Vector3( -0.5, 0, 0 ) );

Moving Z instead, no visual change in local origin at all! WTF?
root.setPivotPoint( new Vector3( -0, 0, 0.5 ) );

Any help demystifying this, appreciated.

Would you be able to supply a repro in a Playground?

See Using External Assets In the Playground | Babylon.js Documentation

2 Likes

It does seem to work - Babylon.js Playground (babylonjs-playground.com) , so a reproduction would be great.

1 Like

Was hoping it was a familiar failure mode. Guess not.

Second time Ive fought and lost this battle with SetPivot, but for expediency I again regressed to the hacky solution of just adding a pos fix factor to the model root, and then added a TransformNode super-root parent on top of that for setting absolute world coords without having to worry about preserving the corrective offset underneath.

Hello @brechindo just checking in, do you still have a issue?

Still avoiding setPivotPoint() because I cant get the expected result from it, yes. Had to code around it and move on for now. It’s a battle for another day.