Ok, just kidding... I am actually feeling charitable today, so I did much of your work for you. The making a model from scratch you will have to figure out on your own, though, I just tested with cubes, and you will have to hunt down the 'b3dfile.bb' include, and modify the 'saveB3d' function from the code archives to do the exporting.
Include "b3dfile.bb"
Type dbMdl
Field name$,posx#,posy#,posz#,rotx#,roty#,rotz#,sclx#,scly#,sclz#,blendmode,fxflags
End Type
FillDatabase()
Dim model(9)
Graphics3D 800,600,0,2
camera=CreateCamera()
PositionEntity camera,0,0,-100
light=CreateLight()
TurnEntity light,45,45,0
m.dbMdl = First dbMdl
model(0) = createmodel()
m\name$ = "model0.b3d"
m\posx = EntityX(model(0))
m\posy = EntityY(model(0))
m\posz = EntityZ(model(0))
m\rotx = EntityPitch(model(0))
m\roty = EntityYaw(model(0))
m\rotz = EntityRoll(model(0))
m\sclx = 1
m\scly = 1
m\sclz = 1
m\blendmode = 1
m\fxflags = 0
; copy meshes and randomize attributes
; and add to type list
For a = 1 To 9
m = After m
model(a) = CopyMesh(model(0))
thisname$ = "model" + a + ".b3d"
PositionEntity model(a),Rnd(-50,50),Rnd(-50,50),Rnd(-10,10)
RotateEntity model(a),Rand(-180,180),Rand(-180,180),Rand(-180,180)
thisscalex# = Rnd(0.1,3)
thisscaley# = Rnd(0.1,3)
thisscalez# = Rnd(0.1,3)
ScaleEntity model(a),thisscalex,thisscaley,thisscalez
thisblendmode = Rand(1,3)
thisfx = Rand(0,32)
EntityBlend model(a),thisblendmode
EntityFX model(a),thisfx
m\name$ = thisname$
m\posx = EntityX(model(a))
m\posy = EntityY(model(a))
m\posz = EntityZ(model(a))
m\rotx = EntityPitch(model(a))
m\roty = EntityYaw(model(a))
m\rotz = EntityRoll(model(a))
m\sclx = thisscalex
m\scly = thisscaley
m\sclz = thisscalez
m\blendmode = thisblendmode
m\fxflags = thisfx
Next
;export .b3d files
For a = 0 To 9
WriteBB3d(thisname$,model(a) ; you'll have to find the 'SaveB3d' function in the code archives and modify it to work here
Next
SaveDatabase("data.dbf")
While Not KeyHit(1)
UpdateWorld
RenderWorld
Flip
Wend
End
Function FillDatabase()
For a = 1 To 100
m.dbMdl = New dbMdl
m\name = ""
m\posx = 0
m\posy = 0
m\posz = 0
m\rotx = 0
m\roty = 0
m\rotz = 0
m\sclx = 0
m\scly = 0
m\sclz = 0
m\blendmode = 0
m\fxflags = 0
Next
End Function
Function SaveDatabase(filename$)
If filename$ <> 0
wfile = WriteFile(filename$)
For m.dbMdl = Each dbMdl
WriteString wfile,m\name
WriteFloat wfile,m\posx
WriteFloat wfile,m\posy
WriteFloat wfile,m\posz
WriteFloat wfile,m\rotx
WriteFloat wfile,m\roty
WriteFloat wfile,m\rotz
WriteFloat wfile,m\sclx
WriteFloat wfile,m\scly
WriteFloat wfile,m\sclz
WriteByte wfile,m\blendmode
WriteInt wfile,m\fxflags
Next
CloseFile wfile
EndIf
End Function
Function CreateModel()
;you do this part ;)
;temporary just for testing
ent = CreateCube()
Return ent
End Function