SAVE MESH This command will save the specified mesh to a file in the XFile text format.
Syntax
    SAVE MESH Filename, Mesh Number
Parameters
    Filename
String The file name string
    Mesh Number
Integer The mesh number to save
Returns
This command does not return a value.
Description
You can use this command to extract and store meshes previously existing as part of a more complex object, or to create a large mesh based world and save it out for later loading as a 3D game level.
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

    save mesh "mymesh.x",MeshNumber

    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