XYZ
XYZ
gets/sets the position of the vertex using local coordinates (distance
from the object center).
Type: list [ x, y, z]
float
values
Sample Code
###### get the vertex position
# get controller
controller = GameLogic.getCurrentController()
# get object the controller is attached to
obj = controller.owner
# get the 1st mesh
mesh = obj.meshes[0]
# get the first vertex of the first material
vert = mesh.getVertex( 0, 0)
# get position of this vertex
pos = vert.XYZ
###### set the vertex position
# get controller
controller = GameLogic.getCurrentController()
# get object the controller is attached to
obj = controller.owner
# get the 1st mesh
mesh = obj.meshes[0]
# get the first vertex of the first material
vert = mesh.getVertex( 0, 0)
# set the position of this vertex
vert.XYZ = [ 1.0, 1.0, 1.0]
|