Hi there,
how is it possible to get all vertices of an object (say a cube) and then randomly change their location? What I want to do is everytime I hit space, the cube alters and generate random shapes.
What I have figured out myself so far:
import bge
import random
cont = bge.logic.getCurrentController()
own = cont.owner
# get the 1st mesh
mesh = own.meshes[0]
# get the first vertex of the first mesh
vert = mesh.getVertex( 0, 0)
# get the position
pos = vert.getXYZ()
# set the position
vert.setXYZ([ 10, 1.0, 15])
How does
getVertex(matid, index)
exactely work? It only gets me one vertex, how can I get one after another? And then alter their position?
Thank you for any hint!