LOAD MESH This command will load a single X file into the specified mesh number.
Syntax
    LOAD MESH Filename, Mesh Number
Parameters
    Filename
String The mesh filename string to load
    Mesh Number
Integer The mesh number to use
Returns
This command does not return a value.
Description
A mesh is a wireframe description of a 3D shape. You must use a filename that points to a file that stores 3D mesh data in the X file format. The mesh number should be specified using an integer value. This command is almost a direct wrapper to the DirectX function "D3DXLoadMeshFromX", and this function will not load all forms of X file. If you experience problems loading a mesh using this command, try the alternative method of LOAD OBJECT "mesh.x",1 : MAKE MESH FROM OBJECT 1,1 : DELETE OBJECT 1
Example Code
    sync on

    sync rate 120

    hide mouse

    cls 0

    ObjectNumber=1

    MeshNumber=1

    LimbNumber=0

    TextureNumber=1

    load mesh "mesh.x",MeshNumber

    load mesh "newmesh.x",MeshNumber+1

    load image "iron.jpg",TextureNumber

    make object ObjectNumber, MeshNumber,TextureNumber

    if mesh exist(MeshNumber)=1 then delete mesh MeshNumber

    make mesh from object MeshNumber, ObjectNumber

    add limb ObjectNumber,LimbNumber+1,MeshNumber

    link limb ObjectNumber,0,LimbNumber+1

    offset limb ObjectNumber,1,1,0,0

    color limb ObjectNumber,LimbNumber+1,rgb(0,255,0)

    scale limb ObjectNumber,LimbNumber+1,50,50,50

    while mouseclick()=0

    set cursor 0,0

    print "press z key"

    if inkey$()="z" then change mesh ObjectNumber, LimbNumber+1, MeshNumber+1

    xrotate object ObjectNumber,wrapvalue(object angle x(ObjectNumber)+1)

    sync

    endwhile

    delete object ObjectNumber

    if mesh exist(MeshNumber)=1 then delete mesh MeshNumber

    if mesh exist(MeshNumber+1)=1 then delete mesh MeshNumber+1

    end
See also
BASIC3D Commands Menu Index