hey folks. ive been off on a tangent these last few days following a concept i came up with several months ago. the concept was essentially, can the mesh loaders of Irrlicht be used in a generic fashion and made available for use in any 3D engine. here is a proof of concept test. it has a long way to go but the initial results i feel have been very encouraging. if you feel adventurous (and your running windows), please download this, give it a whirl, and report back on FPS and memory usage. FYI... it takes a few seconds to load due to the size of the BSP model its loading. folks familiar with Irrlicht should recognize the models :)
http://www.gprogs.com/irrlicht.mod/2007_01_10_model_loader_example2.zip
the example is using MiniB3D to render the models. the code is :
http://www.gprogs.com/irrlicht.mod/2007_01_10_model_loader_example2.zip
the example is using MiniB3D to render the models. the code is :
Strict Framework BRL.Blitz Import "minib3d.bmx" Import Irrlicht.Core Import "minib3d_meshloader.bmx" Import BRL.BMPLoader Import BRL.JPGLoader Import BRL.PNGLoader Local width=640,height=480,depth=16,mode=0 Graphics3D width,height,depth,mode IrrlichtMeshLoader.AddZipFileArchive("map-20kdm2.pk3") Local ent1:IrrlichtMesh=IrrlichtMeshLoader.LoadMesh("20kdm2.bsp").CreateMesh() PositionEntity ent1,-1370,-130,-1400 Local ent2:IrrlichtMesh=IrrlichtMeshLoader.LoadMesh("dwarf.x").CreateMesh() PositionEntity ent2,-70,0,-90 ent2.setFramesPerSec(15) Local ent3:IrrlichtMesh=IrrlichtMeshLoader.LoadMesh("sydney.md2").CreateMesh() PositionEntity ent3,-20,0,-60 entitytexture(ent3,loadtexture("sydney.bmp")) ent3.setFramesPerSec(70) Local ent4:IrrlichtMesh=IrrlichtMeshLoader.LoadMesh("faerie.md2").CreateMesh() PositionEntity ent4,-70,0,-30 entitytexture(ent4,loadtexture("faerie2.bmp")) Local ent5:IrrlichtMesh=IrrlichtMeshLoader.LoadMesh("faerie.md2").CreateMesh() PositionEntity ent5,-70,0,-45 entitytexture(ent5,loadtexture("faerie2.bmp")) ent5.setFramesPerSec(55) Local ent6:IrrlichtMesh=IrrlichtMeshLoader.LoadMesh("faerie.md2").CreateMesh() PositionEntity ent6,-70,0,-60 entitytexture(ent6,loadtexture("faerie2.bmp")) ent6.setFramesPerSec(70) Local ent7:IrrlichtMesh=IrrlichtMeshLoader.LoadMesh("faerie.md2").CreateMesh() PositionEntity ent7,-70,0,-75 entitytexture(ent7,loadtexture("faerie2.bmp")) ent7.setFramesPerSec(95) Local ent8:IrrlichtMesh=IrrlichtMeshLoader.LoadMesh("bird.b3d").CreateMesh() PositionEntity ent8,-30,20,-90 ent8.setFramesPerSec(2000) Local cam:TCamera=CreateCamera() Local light:TLight=CreateLight() PositionEntity cam,-100,50,-150 ' used by camera code Local mxs#=0 Local mys#=0 Local move#=2.0 MouseXSpeed() ' flush MouseYSpeed() ' flush ' used by fps code Local old_ms=MilliSecs() Local renders Local fps Local anim_time#=0 Local memory:Int=GCMemAlloced() While Not KeyDown(KEY_ESCAPE) If KeyHit(KEY_ENTER) Then DebugStop '' control camera ' mouse look mxs#=mxs#+(MouseXSpeed()/5.0) mys#=mys#+(MouseYSpeed()/5.0) RotateEntity cam,mys#,-mxs#,0 MoveMouse width/2,height/2 MouseXSpeed() ' flush MouseYSpeed() ' flush ' move camera forwards/backwards/left/right with cursor keys If KeyDown(KEY_UP)=True Then MoveEntity cam,0,0,move# ' move camera forward If KeyDown(KEY_DOWN)=True Then MoveEntity cam,0,0,-move# ' move camera back If KeyDown(KEY_LEFT)=True Then MoveEntity cam,-move#,0,0 ' move camera left If KeyDown(KEY_RIGHT)=True Then MoveEntity cam,move#,0,0 ' move camera right '' 'SetAnimTime(mesh_list[0],anim_time#) RenderWorld renders=renders+1 ' calculate fps If MilliSecs()-old_ms>=1000 old_ms=MilliSecs() fps=renders renders=0 memory=GCMemAlloced() EndIf IrrlichtMeshLoader.UpdateWorld() DebugText 0,0,"FPS: "+String(fps) DebugText 0,20,"Mem: "+memory Flip Wend End