SetMeshData()

Syntax

Result = SetMeshData(#Mesh, SubMesh, DataArray(), Flags, FirstIndex, LastIndex)
Description
Set internal mesh data, like vertices, face etc. Dynamic meshes are not supported (meshes created with the #PB_Mesh_Dynamic flag).

Parameters

#Mesh The mesh to use.
SubMesh The submesh to set the data to. The first submesh index is 0 (main mesh).
DataArray() The array containing the data to set. It has to be an array of type "PB_MeshVertex" or "PB_MeshFace" depending of the specified flags.
Flags Specifies which kind of data needs to be set. It can be one of the following values:
  #PB_Mesh_Vertex: DataArray() is an array of type "PB_MeshVertex".
  #PB_Mesh_Face  : DataArray() is an array of type "PB_MeshFace".
combined with:
  #PB_Mesh_UVCoordinate : Set the UV coordinate information (only for #PB_Mesh_Vertex flag)
  #PB_Mesh_Normal       : Set the normal information (only for #PB_Mesh_Vertex flag)
  #PB_Mesh_Color        : Set the color information (only for #PB_Mesh_Vertex flag)
The "PB_MeshVertex" and "PB_MeshFace" structures are defined like this:
  Structure PB_MeshVertex
    x.f
    y.f
    z.f
    NormalX.f ; only used if #PB_Mesh_Normal flag is set
    NormalY.f ;
    NormalZ.f ;
    TangentX.f
    TangentY.f
    TangentZ.f
    u.f       ; only used if #PB_Mesh_UVCoordinate flag is set
    v.f       ;
    Color.l   ; only used if #PB_Mesh_Color flag is set
  EndStructure    
  
  Structure PB_MeshFace
    Index.l
  EndStructure   
FirstIndex, LastIndex First and last index to set the data to.

Return value

Returns nonzero on success and zero on failure.

See Also

GetMeshData()

Supported OS

All

<- SaveMesh() - Mesh Index - SetMeshMaterial() ->