normal
normal
gets/sets the normal vector of the vertex.
Type: List [ nx, ny, nz]
nx = cosine of the
normal to the world x-axis
Type: float
ny = cosine of the
normal to the world y-axis
Type: float
nz = cosine of the
normal to the world z-axis
Type: float
Sample Code
###### get the vertex normal vector
# 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 normal of this vertex
nor = vert.normal
###### set the vertex normal vector
# 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 normal of this vertex
vert.normal = [ 0.0, 0.0, 1.0]
|