GetMeshData()

Syntax

Result = GetMeshData(#Mesh, SubMesh, DataArray(), Flags, FirstIndex, LastIndex)
Description
Get 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 get the data from. The first submesh index is 0 (main mesh).
DataArray() The array to receive the data. 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 retrieved. 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 : Get the UV coordinate information (only for #PB_Mesh_Vertex flag)
  #PB_Mesh_Normal       : Get the normal information (only for #PB_Mesh_Vertex flag)
  #PB_Mesh_Color        : Get the color information (only for #PB_Mesh_Vertex flag)
  #PB_Mesh_Tangent      : Get the tangent 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 get the data from.

Return value

Returns nonzero on success and zero on failure. If success, DataArray() has been resized and contains the mesh information.

See Also

SetMeshData()

Supported OS

All

<- FreeMesh() - Mesh Index - IsMesh() ->