vec_for_mesh (VECTOR*, ENTITY*, var number)

vec_to_mesh (VECTOR*, ENTITY*, var number)

Performs realtime mesh deformation of a model or terrain entity. vec_for_mesh sets the VECTOR to the mesh coordinates of the given vertex number; vec_to_mesh sets the vertex to a new mesh position given by the VECTOR.


VECTOR* xyz mesh coordinate.
ENTITY* Entity pointer.
number Number of the mesh vertex in the MED status line.


VECTOR* - set to the vertex coordinate by vec_for_mesh.




Example (lite-C):

function dent(ENTITY* ent,var num) // make a "dent" into a mesh
{ vec_for_mesh(temp,ent,num); vec_scale(temp,0.9); // move the vertex inwards by 10% vec_to_mesh(temp,ent,num); you = ent;
ent_fixnormals(you,your.frame) }

See also:

ent_vertices, ent_fixnormals, vec_for_vertex, vec_for_normal, vec_for_uv, vec_for_min, vec_for_max

► latest version online