CreateMesh()

Syntax

Result = CreateMesh(#Mesh [, Type [, Mode])
Description
Creates a new empty #Mesh. After creation the further commands of this library like MeshVertexPosition() or MeshFace() can be used, to build it.

Parameters

#Mesh The number to identify the new mesh. #PB_Any can be used to auto-generate this number.
Type (optional) The type of the new mesh. It can be one of the following value:
  #PB_Mesh_TriangleList : the mesh will be composed of a list of triangles (default).
  #PB_Mesh_TriangleStrip: the mesh will be composed of a list of connected triangles (vertices are shared).
  #PB_Mesh_TriangleFan  : the mesh will be composed of a list of triangles sharing the same central vertex point.
  #PB_Mesh_PointList    : the mesh will be composed of a list of points.
  #PB_Mesh_LineList     : the mesh will be composed of a list of lines.
  #PB_Mesh_LineStrip    : the mesh will be composed of a list of connected lines (vertices are shared).
Mode (optional) The mode of the new mesh. It can be one of the following value:
  #PB_Mesh_Static : once created, the mesh can't be modified anymore with the mesh update functions (default). 
  #PB_Mesh_Dynamic: once created, the mesh can be modified with the mesh update functions.

Return value

Returns nonzero if the mesh was created successfully and zero if there was an error. If #PB_Any was used as the #Mesh parameter then the new generated number is returned on success.

Remarks

If the #Mesh was already created, then it is freed and replaced by a new one.

Supported OS

All

<- CreateLine3D() - Mesh Index - CreatePlane() ->