I use this to save my own meshes ...
Function save_mesh(mesh,mesh_name$)
mesh_name$=mesh_name$+".my3d"
UpdateNormals mesh
file=WriteFile(mesh_name)
WriteInt(file,CountSurfaces(mesh))
For surface_num=1 To CountSurfaces(mesh)
temp_surface=GetSurface(mesh,surface_num)
WriteInt(file,CountVertices(temp_surface))
For vertex_num=0 To CountVertices(temp_surface)-1
WriteFloat(file,VertexX#(temp_surface,vertex_num))
WriteFloat(file,VertexY#(temp_surface,vertex_num))
WriteFloat(file,VertexZ#(temp_surface,vertex_num))
WriteFloat(file,VertexNX#(temp_surface,vertex_num))
WriteFloat(file,VertexNY#(temp_surface,vertex_num))
WriteFloat(file,VertexNZ#(temp_surface,vertex_num))
WriteFloat(file,VertexRed#(temp_surface,vertex_num))
WriteFloat(file,VertexGreen#(temp_surface,vertex_num))
WriteFloat(file,VertexBlue#(temp_surface,vertex_num))
WriteFloat(file,VertexU#(temp_surface,vertex_num))
WriteFloat(file,VertexV#(temp_surface,vertex_num))
WriteFloat(file,VertexW#(temp_surface,vertex_num))
Next
WriteInt(file,CountTriangles(temp_surface))
For triangle_num=0 To CountTriangles(temp_surface)-1
WriteInt(file,TriangleVertex(temp_surface,triangle_num,0))
WriteInt(file,TriangleVertex(temp_surface,triangle_num,1))
WriteInt(file,TriangleVertex(temp_surface,triangle_num,2))
Next
Next
CloseFile file
End Function
and this to load them ..
Function load_mesh(mesh_name$,blend,fx,parent,show)
DebugLog mesh_name$
mesh_name=mesh_name+".my3d"
file=ReadFile(mesh_name$)
If file=0 RuntimeError mesh_name+": MY3D not found !!"
mesh=CreateMesh(parent):surfaces=ReadInt(file)
For surface_num=1 To surfaces
temp_surface=CreateSurface(mesh)
vertices=ReadInt(file)
For vertex_num=0 To vertices-1
x#=ReadFloat(file):y#=ReadFloat(file):z#=ReadFloat(file)
temp_vertex=AddVertex(temp_surface,x,y,z)
nx#=ReadFloat(file):ny#=ReadFloat(file):nz#=ReadFloat(file)
VertexNormal temp_surface,temp_vertex,nx,ny,nz
r#=ReadFloat(file):g#=ReadFloat(file):b#=ReadFloat(file)
VertexColor temp_surface,temp_vertex,r,g,b
u#=ReadFloat(file):v#=ReadFloat(file):w#=ReadFloat(file)
VertexTexCoords temp_surface,temp_vertex,u,v,w
Next
triangles=ReadInt(file)
For triangle_num=0 To triangles-1
v0=ReadInt(file):v1=ReadInt(file):v2=ReadInt(file)
AddTriangle(temp_surface,v0,v1,v2)
Next
Next
CloseFile file
EntityBlend mesh,blend
EntityFX mesh,fx
If Not show HideEntity mesh
Return mesh
End Function
May be of some use to use.