How to make the center point handle of the model coincide with the center point of the model itself

How to make the center point handle of the model coincide with the center point of the model itself

let objectzero = new BABYLON.TransformNode(ā€œanchorā€);
Is there a better way to use this that doesnā€™t fit my application scenario

Hi,
Iā€™m gonna link this to:

Now what exactly is your issue with this solution? Iā€™m not sure to understand your problem (sorry).

1 Like

Understand that you would need to give us more details on why it doesnā€™t match your scenario. Else, I donā€™t think anybody will be able to just ā€˜guessā€™. A PG would be the best but else, try to at least expose us this scenario, like: How the meshes are sourced; What format they have; How you manage and implement them and What sort of transformation you (or the user) should be able to make.

Among all topics on this subject (if you did read them), there are already at least 4 solutions to this type of problem:

Solution 1: Edit the model in 3d-app and recenter axis
Solution 2: Use utility tool to process model and recenter axis
Solution 3: Transform the model in BJS and recenter axis
Solution 4 (the one I gave you): Use bounding box hierarchy to translate the center and parent to new.

Thereā€™s even a fith solution where somebody created his own script (and shared it with us from his gh rep).

Itā€™s hard for me to understand why none of these solutions (even with an adaptation) would be applicable to your use case. As I said, you would need to explain a bit further.

In case it helps, you can use setPivotPoint to define the pivot point of your mesh.

True. I eventually forgot about this one. Thanks for the reminder :hugs:. I might use it in my project instead of parenting.