This is rather simple to do with vertex commands.
The code below is a test program I made a while back which shows the difference in performance between 100 objects and those 100 objects combined into one. I don't have time to explain it all now, but I'll come back to this thread in a bit.
The simplest way to deal with texturing is to have every object use the same texture file, that way you don't have to deal with changing UV data.
Sync On : Sync Rate 0
Type Vertex
x As Float
y As Float
z As Float
nx As Float
ny As Float
nz As Float
u As Float
v As Float
EndType
Global gVert As Vertex
Dim verts() As Vertex
Global nullVert As Vertex
Cls
Ink Rgb(0,255,0), 0
Box 0, 0, 128, 128
Get Image 1, 0, 0, 128, 128, 1
For i = 1 To 100
Make Object Plane i, 10.0, 10.0
Texture Object i, 1
XRotate Object i, 90.0
Position Object i, ((i-1)/10)*10.0, 0.0, ((i-1) Mod 10)*10.0
Next i
`mapObj = MakeMapObject() REM Uncomment this line to see the difference! ********************** <<<<<<<
Position Camera 0.0, 100.0, 0.0
Point Camera 50.0, 0.0, 50.0
Do
Text 5, 5, Str$(Screen FPS())
Sync
Loop
Function FreeMemblock(n)
For i = n To 65535
If Memblock Exist(i) = 0 Then ExitFunction i
Next i
EndFunction -1
Function MakeMemblock(size)
m = FreeMemblock(1)
Make Memblock m, size
EndFunction m
Function MakeMapObject()
For i = 1 To 100
ObjectToVertices(i)
Delete Object i
Next i
numVerts = Array Count(verts())+1
mapMem = MakeMemblock(12+32*(numVerts))
Write Memblock Dword mapMem, 0, 274
Write Memblock Dword mapMem, 4, 32
Write Memblock Dword mapMem, 8, numVerts
For i = 0 To numVerts-1
SetVertexPosition(mapMem, i, verts(i).x, verts(i).y, verts(i).z)
SetVertexUV(mapMem, i, verts(i).u, verts(i).v)
SetVertexNormals(mapMem, i, verts(i).nx, verts(i).ny, verts(i).nz)
Next i
mapObj = 1000 `FreeObject(1)
Make Mesh From Memblock mapObj, mapMem
Make Object mapObj, mapObj, 1
Delete Mesh mapObj
Delete Memblock mapMem
Empty Array verts()
EndFunction mapObj
Function ObjectToVertices(obj)
x# = Object Position X(obj)
y# = Object Position Y(obj)
z# = Object Position Z(obj)
Make Mesh From Object obj, obj
Lock VertexData For Mesh obj
numVs = Get VertexData Vertex Count()
`numIs = Get VertexData Index Count()
numIters = numVs
If numIs > 0 Then numIters = numIs
For i = 0 To numIters-1
If numIs > 0
vdi = Get IndexData(i)
Else
vdi = i
EndIf
StoreGVert(vdi)
AddVertex(x#+gVert.x, y#+gVert.y, z#+gVert.z, gVert.nx, gVert.ny, gVert.nz, gVert.u, gVert.v)
Next i
Unlock VertexData
Delete Mesh obj
EndFunction
Function StoreGVert(v)
gVert.x = Get VertexData Position X(v)
gVert.y = Get VertexData Position Y(v)
gVert.z = Get VertexData Position Z(v)
gVert.nx = Get VertexData Normals X(v)
gVert.ny = Get VertexData Normals Y(v)
gVert.nz = Get VertexData Normals Z(v)
gVert.u = Get VertexData U(v)
gVert.v = Get VertexData V(v)
EndFunction
Function AddVertex(x#, y#, z#, nx#, ny#, nz#, u#, v#)
tv As Vertex
tv.x = x#
tv.y = y#
tv.z = z#
tv.nx = nx#
tv.ny = ny#
tv.nz = nz#
tv.u = u#
tv.v = v#
Array Insert At Bottom verts()
verts() = tv
EndFunction
Function SetVertexPosition(mem, v, x#, y#, z#)
Write Memblock Float mem, v*32+12, x#
Write Memblock Float mem, v*32+16, y#
Write Memblock Float mem, v*32+20, z#
EndFunction
Function SetVertexNormals(mem, v, nx#, ny#, nz#)
Write Memblock Float mem, v*32+24, nx#
Write Memblock Float mem, v*32+28, ny#
Write Memblock Float mem, v*32+32, nz#
EndFunction
Function SetVertexUV(mem, v, u#, v#)
Write Memblock Float mem, v*32+36, u#
Write Memblock Float mem, v*32+40, v#
EndFunction
NaGaFailMo.