Get world position of a vertex

Hello, I’m trying to get the world position of a vertex to be able to add an object at the position.

spawn_point = self.object.worldPosition + vertex_position
particle = self.object.scene.addObject("object_to_add", self.object, self.death)
particle.worldPosition = spawn_point

This code above works very well, but when I rotate the mesh owner, the added object loses its ideal position. Does anyone know how I can solve?

For 0.3.0
Object.worldTransform @ Vector([x, y, z])
this is to get a position of a point in local space to the actor.

To get the location of a specific vertex in a not deformed agent.
Object.worldTransform @ Object.blenderObject.data.vertices[index].co

From here if you need the deformed cord you can use the depsgraph a d check the evaluated mesh.

For 0.2.5
Same but @ is * in old bge.
Also KX_mesh is replaced by blender Object in 2.8

So in 2.79 /
Vert = object.meshes[0].getVertex(M_index,v_index)

I thnk, it’s been a while

1 Like

I think multiply the (object position + vertex position) by the object orientation matrix

1 Like