I’m trying to figure out at the very basics how to set vertex position according to the color value texture has.
I already know how to loop through mesh vertices, but I have no idea how to read a texture for manipulation.
Should this be done with a GLSL shader or the more “general” method as in:
obj = cont.owner
cam = bge.logic.getCurrentScene().active_camera
cam_x = cam.worldOrientation[0]
mesh = obj.meshes[0]
length = mesh.getVertexArrayLength(0)
for array in range(0, length):
vertex = mesh.getVertex(0, array)
#Vertex manipulation here