Center of rotation not setting up on the default position

Hello community, I’m having problem with animations in babylon js. While rotation around z axis it is taking the bottom of the mesh as center for rotation, I think the default should be the center of the mesh. I don’t know what i’m missing, I have set the pivot correctly in the blender and exported it correctly. For all the glb files it is taking the bottom as the center of rotation,

can anyone help??

Hello :slight_smile:

Can you share a playground reproducing your problem or at least some code showing how you rotate you mesh ? If you directly modify mesh.rotation it should rotate around the pivot center indeed. But if you use for example mesh.rotate() with a specific Axis, then it could rotate around another point…

Also sharing an example of a .GLB with the problem would help (you can share .zip in a post)

2 Likes

I’ve encountered a similar issue while working on endless customization options with Zolak furniture configurator. When using Babylon.js, ensure the pivot point is correctly set in Blender before exporting your GLB files. In Blender, select the mesh, go to Object > Set Origin > Origin to Geometry to center the pivot. After exporting, double-check the pivot point in Babylon.js using mesh.setPivotMatrix(BABYLON.Matrix.Translation(x, y, z)); to adjust it if necessary.

Hope this helps!

Thank you @Tricotou, Fixed by changing the pivot

1 Like