here is what i mean:
`%Project Title%
`main.dba
`======================
autocam off
load object "c:\Users\GogetaX\Desktop\Dark Occlusion 1.0.0\Media\House_LOD0.X",1
hide object 1
exclude object on 1
a as integer
b as integer
c as integer
global obj as integer
global DrawnObjects as Integer
obj = 1
sizex as integer
sizez as integer
sizex = object size x(1)+20
sizez = object size z(1)+20
sync on
type TMyObjData
PosX as Integer
PosY as Integer
PosZ as Integer
Hiden as Boolean
Excluded as Boolean
objNum as Integer
endtype
dim MyObjData(0) as TMyObjData
for a=0 to 71
for b =0 to 71
inc obj
clone object obj,1
position object obj,a*sizex,0,b*sizez
dim MyObjData(array count(MyObjData(0))+1) as TMyObjData
c = array count(MyObjData(0))-1
MyObjData(c).PosX = object position x(obj)
MyObjData(c).PosY = object position y(Obj)
MyObjData(c).PosZ = object position z(Obj)
MyObjData(c).Excluded = 1
MyObjData(c).Hiden = 1
MyObjData(c).ObjNum = Obj
hide object obj
exclude object on obj
next b
next a
space as byte
space = 0
wire as boolean
wire = 1
do
TimeSync()
text 0,0,"FPS:"+str$(MyFPS)
text 0,15,"Total Objects: "+str$(Obj-1)
text 0,30,"Drawn Objects: "+str$(DrawnObjects)
text 0,45,"Drawn Polygons: "+str$(statistic(1))
text 0,60,"Hit Space to swich bettween Wireframe"
RTLSystem(400,0)
if spacekey()=0 and space = 2 then space = 0
if space = 1
if wire = 0
for a=2 to obj
set object wireframe a,0
next a
wire = 1
else
for a=2 to obj
set object wireframe a,1
next a
wire = 0
endif
space = 2
endif
if spacekey() and space = 0 then space = 1
move camera (upkey()-downkey())*(OFT*0.3)
yrotate camera camera angle y()+(rightkey()-leftkey())*(OFT*0.3)
fastsync
loop
function RTLSystem(ShownDistance as Integer,SmoothLoad as Boolean)
a as integer
camx as integer
camy as integer
camz as integer
camx = camera position x()
camy = camera position y()
camz = camera position z()
DrawnObjects = 0
dist as integer
for a =0 to array count(MyObjData(0))-1
if MyObjData(a).Hiden = 0 then inc DrawnObjects
next a
for a =0 to array count(MyObjData(0))-1
dist = GetDistanceFromXYZtoXYZ(camx,MyObjData(a).PosX,0,0,camz,MyObjData(a).PosZ)
if dist <= ShownDistance
if MyObjData(a).Excluded
exclude object off MyObjData(a).ObjNum
MyObjData(a).Excluded = 0
if SmoothLoad then exitfunction
endif
if MyObjData(a).Excluded = 0
if object in screen(MyObjData(a).ObjNum)
if MyObjData(a).Hiden
show object MyObjData(a).ObjNum
MyObjData(a).Hiden = 0
if SmoothLoad then exitfunction
endif
else
if MyObjData(a).Hiden = 0
hide object MyObjData(a).ObjNum
MyObjData(a).Hiden = 1
if SmoothLoad then exitfunction
endif
endif
endif
else
if MyObjData(a).Excluded = 0
hide object MyObjData(a).ObjNum
exclude object on MyObjData(a).ObjNum
MyObjData(a).Excluded = 1
MyObjData(a).Hiden = 1
if SmoothLoad then exitfunction
endif
endif
next a
endfunction
//few functions i use
global TMP as Float
global TMM as Float
global MyTimer as Integer
global OldTimer as Integer
global FrameCounter as Float
global MyDefFPS as Float
global MyFPS as Float
global OFTtmp as Integer
global OFTtmp2 as Float
global OFT as Float
function TimeSync()
MyFPS = CurveValue(MyDefFPS,MyFps,TMM)
if MyFPS <=0 then MyFPS = 60
if MyDefFPS <=0 then MyDefFPS = 60
inc FrameCounter
OFTtmp2 = timer()-OFTtmp
MyTimer = Timer()
OFTtmp = MyTimer
if OldTimer+320<=MyTimer
OldTimer = MyTimer;
MyDefFPS = FrameCounter*3.125
FrameCounter = 0
ENDIF
TM = 1001 - MyDefFPS
OFT = CurveValue(OFTtmp2,OFT,TMM)
TMM = MyDefFPS * 0.1
ENDFUNCTION
function GetDistanceFromXYZtoXYZ(x1#,x2#,y1#,y2#,z1#,z2#)
d#=sqrt(((x2#-x1#)*(x2#-x1#))+((y2#-y1#)*(y2#-y1#))+((z2#-z1#)*(z2#-z1#)))
d# = abs(d#)
endfunction d#
it load up to 5000 objects, same house as urs, about 20 times faster load than yours. and the fps runs 50 times better than your engine. also all the models are dynamic.. with pure dbp code..
so what exactly you tryed to accomplish?
or as i said, maybe i missing something?
more 3d models .x/.obj and more foramts here:
[href]https://www.turbosquid.com/Search/Index.cfm?keyword=gogetax1&x=0&y=0[href]