How to get vertex data of a sphere after it has been rotated?

Hi,

I’m getting the vertices of a sphere via:

this.sphere = MeshBuilder.CreateSphere("sphere"+this.no, {
        diameter: 40,
        segments: 8
    }, this.scene);

let verts = this.sphere.getVerticesData("position",true);
log(verts);

However if I rotate that sphere and then try to get the verts, the data returned is identical to the non rotated data. How can I get the vertex data of the mesh after it has had rotations applied?

Using this function before you retrieve the positions:
https://doc.babylonjs.com/api/classes/babylon.mesh#bakecurrenttransformintovertices

2 Likes

Perfect, thank you :slight_smile: