Meshes

Function LoadMesh(mesh_file$)

Returns a mesh id for the loaded mesh.

Supported formats:

  • Animated objects: B3D files (.b3d, r, skeleton), Microsoft DirectX (.x, r), (binary & text, skeleton), Milkshape (.ms3d, r, skeleton), Quake 3 models (.md3, r, morph), Quake 2 models (.md2, r, morph).
  • Static objects: Irrlicht scenes (.irr, r/w), Irrlicht static meshes (.irrmesh, r/w), 3D Studio meshes (.3ds, r), Alias Wavefront Maya (.obj, r/w), Lightwave Objects (.lwo, r), COLLADA 1.4 (.xml, dae, r/w), OGRE meshes (.mesh, r), My3DTools 3 (.my3D, r), Pulsar LMTools (.lmts, r), Quake 3 levels (.bsp, r), DeleD (.dmf, r), FSRad oct (.oct, r), Cartography shop 4 (.csm, r), STL 3D files (.stl, r/w), PLY 3D files (.ply, r/w).

Sub DeleteMesh(mesh)

Removes a mesh from memory.


Function CreateMesh()

Returns a new mesh


Sub AddMeshBuffer(mesh, vertex_count, ByRef vertex_data, ByRef normal_data, ByRef uv_data, index_count, ByRef index_data)

Sets the vertices, normals, and texture coordinates for a mesh

See also

CreateMesh()


Function LoadMeshFromArchive(archive$, mesh_file$)

Returns a mesh id for the loaded mesh.

Supported formats:

  • Animated objects: B3D files (.b3d, r, skeleton), Microsoft DirectX (.x, r), (binary & text, skeleton), Milkshape (.ms3d, r, skeleton), Quake 3 models (.md3, r, morph), Quake 2 models (.md2, r, morph).
  • Static objects: Irrlicht scenes (.irr, r/w), Irrlicht static meshes (.irrmesh, r/w), 3D Studio meshes (.3ds, r), Alias Wavefront Maya (.obj, r/w), Lightwave Objects (.lwo, r), COLLADA 1.4 (.xml, dae, r/w), OGRE meshes (.mesh, r), My3DTools 3 (.my3D, r), Pulsar LMTools (.lmts, r), Quake 3 levels (.bsp, r), DeleD (.dmf, r), FSRad oct (.oct, r), Cartography shop 4 (.csm, r), STL 3D files (.stl, r/w), PLY 3D files (.ply, r/w).

See also

LoadMesh()


Function CreatePlaneMesh(w, h, tileCount_w, tileCount_h)

Creates a flat plane w, h - The width and height of the plane tileCount_w, TileCount_h - The number of subdivisions across and down the plane


Function LoadAN8(an8_file$)

Loads an an8 project and returns an id that can be used in LoadMeshFromAN8()


Function LoadMeshFromAN8(an8_project, an8_scene$)

Loads the figures in an anim8or scene as a mesh Note: This only loads figures from a scene and it loads meshes not anim8or objects


Function GetNumAN8Scenes(an8_project)

Returns the number of scenes in an an8 project

See also

LoadAN8()


Function GetAN8SceneName$(an8_project, scene_num)

Returns the name of a scene in an an8 project.


Function CreateConeMesh(radius, cone_length, tesselation, top_color, bottom_color)

Create a cone mesh


Function CreateCylinderMesh(radius, cylinder_length, tesselation, color, close_top)

Create a cylinder mesh


Function CreateVolumeLightMesh(u, v, foot_color, tail_color, lp_distance, dim_x, dim_y, dim_z)

Create a mesh to represent a light volume.


Sub DeleteAN8(an8_project)

Clears a anim8or project from program memory.


Sub SetMeshBoundingBox(mesh, min_x, min_y, min_z, max_x, max_y, max_z)

Sets the min and max corners of a meshes bounding box. NOTE: Physics shapes are determined from the bounding box data so you should adjust this before setting the shape.


Sub GetMeshBoundingBox(mesh, ByRef min_x, ByRef min_y, ByRef min_z, ByRef max_x, ByRef max_y, ByRef max_z)

Gets the min and max corners of a mesh’s bounding box


Sub ReCalculateMeshBoundingBox(mesh)

Sets the bounding box for a mesh based of its current data


Function MakePlanarTextureMap(mesh, resolution)

Makes a planar texture map for the mesh.

Resolution is a ratio of the world space to texture space NOTE: Value should be between 0 and 1, a recommended value to start with is 0.001.


Sub ReCalculateMeshNormals(mesh)

Calculates the facing direction of the normals in a mesh.


Function GetMeshPolygonCount(mesh)

Returns the number of polygons in a mesh


Sub FlipMeshSurfaces(mesh)

Changes the facing direction of triangles in a mesh.


Function SetMeshBuffer(mesh_id, buffer_num, vertex_count, ByRef vertex_data, ByRef normal_data, ByRef uv_data, index_count, ByRef index_data)

Sets the contents of a mesh buffer. Buffer_num must already exists in mesh.

Returns TRUE if successful and FALSE if not


Function GetMeshBufferCount(mesh_id)

Returns the number of mesh buffers in a mesh.


Function GetMeshBufferVertexCount(mesh_id, buffer_index)

Returns the number of vertices in a mesh buffer.


Function GetMeshBufferIndexCount(mesh_id, buffer_index)

Returns the number of indices in a mesh buffer.


Function GetMeshBuffer(mesh_id, buffer_index, ByRef vertex_data, ByRef normal_data, ByRef uv_data, ByRef index_data)

Gets the data in a mesh buffer.

Returns TRUE if successful and FALSE if not.