x
x
gets/sets the x position of the vertex using local coordinates
(distance from the object center).
Type: float
Sample
Code
###### get the vertex x 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 x position of the vertex
x_pos = vert.x
###### set the vertex x 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 the x position of this vertex
vert.x = 1.0
|