Custom Mesh is not rotatin over its on axis

Dear friends,

Im trying to rotate a plane made as custom mesh over its own centered axis, but when I put that plane to rotate it rotates over an axis on one of the corners.

Can someone help me to solve this issue?

See on the playground what is happening: https://playground.babylonjs.com/#VKBJN#3968

Im trying to perform this rotation: https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTc9B9Q-nIcwGJkiOMtIqvGhmVB8DiaDMVvrw2FTj5TD86kZBZddwh3wj1zM6C8WpRwEdg&usqp=CAU
images

The custom mesh doesn’t appear to be perfectly aligned to the axis. You can add this line to center the rotation:

customMesh2.setPivotPoint(customMesh2.getBoundingInfo().boundingBox.center)

do you know how to put the rotation axis on the same direction on the bounding box? The center is parallel to the world axis

I’m not sure what are you trying to achieve, however because your custom mesh is not centered it will never rotate like the one on the picture.

These positions for example are perfectly aligned aroung the zero origin point:

    const positions = [
        -10, -1, 0,
        -10, 1, 0,
        10, 1, 0,
        10, -1, 0
    ]

The only thing you have to do is to recalc your coords so they are centered/aligned.
Or you can use position/rotation on the mesh to transform your mesh to a centered position and then you can use customMesh.bakeCurrentTransformIntoVertices() to bake the transform to the mesh.