gg.IrrB3D - lost in translation

BlitzMax Forums/BlitzMax Programming/gg.IrrB3D - lost in translation

gman(Posted 2005) [#1]
by probably next weekend i will have the majority of the 3D specific B3D commands converted to a B3D-like framework in BMAX using the gg Irrlicht mods as the rendering engine. my goal is to get most of the 3D and 2D B3D function set into the framework and working as close as possible to B3D. im seeking healthy individuals with patience and understanding to donate some time and preview/try out what i have in order to guage how im doing in the conversion. you will need to have the current Irrlicht mods and good knowledge of B3D. im looking for folks to attempt simple 3D programs using the commands and note descrepancies (other than what i already note as being different) from regular B3D. also, i will be asking a few Q's due to my lack of knowledge of B3D and the lack of samples/documentation for some of the commands. i will provide some simple documentation on the converted commands and the gg.IrrB3D mod.

to answer a few questions off the bat:

- im not sure when it will be done. i would estimate at least a month out if my time goes well.

- yes it will be free.

- no it wont be exact. there are definately things it wont be able to do, but there will also be a lot of things it can do that you werent able to do in B3D.

- yes you will still have full access to the Irrlicht engine.

- it will not be mac compatible yet. Irrlicht has announced that they are incorporating the first version of the mac port in v0.13 so look for that in the coming months.

here is some sample code:
Strict 
Framework gg.IrrB3D

ib3d_Graphics3D(640,480)

Local cam:CAMERA=ib3d_CreateCamera(Null,CT_FPS)
ib3d_PositionEntity(cam,0,30,-200)
ib3d_CameraProject(cam,0,5,0)
ib3d_CameraViewport(cam,0,0,640,240)

Local cam2:CAMERA=ib3d_CreateCamera()
ib3d_PositionEntity(cam2,0,30,-40)
ib3d_CameraViewport(cam2,0,240,640,480)

Local syd:MESH=ib3d_LoadAnimMesh("sydney.md2")
ib3d_EntityTexture(syd,ib3d_LoadTexture("sydney.bmp"))
ib3d_EntityColor(syd,255,0,0)

Local light:LIGHT=ib3d_CreateLight()
ib3d_LightColor(light,255,255,0)
ib3d_LightRange(light,1000)
ib3d_LightCastShadows(light,True)

ib3d_CameraClsColor(200,200,200)
ib3d_ShadowColor(150,0,0,0)

ib3d_EntityDebugDataVisible(syd,True)

ib3d_AddZipFileArchive("map-20kdm2.pk3")

Local quake:MESH=ib3d_LoadOctTreeMesh("20kdm2.bsp")

ib3d_PositionEntity(quake,-1300,-144,-1249)

Local zoom:Float=1.0

While Not ib3d_KeyDown(EKEY_ESCAPE)
	If ib3d_KeyDown(EKEY_KEY_Z) Then zoom:+0.005
	If ib3d_KeyDown(EKEY_KEY_X) Then zoom:-0.005
	
	If ib3d_KeyDown(EKEY_NUMPAD9) Then ib3d_MoveEntity(cam2,0,1,0)
	If ib3d_KeyDown(EKEY_NUMPAD3) Then ib3d_MoveEntity(cam2,0,-1,0)
	If ib3d_KeyDown(EKEY_NUMPAD6) Then ib3d_MoveEntity(cam2,1,0,0)
	If ib3d_KeyDown(EKEY_NUMPAD4) Then ib3d_MoveEntity(cam2,-1,0,0)
	If ib3d_KeyDown(EKEY_NUMPAD8) Then ib3d_MoveEntity(cam2,0,0,-1)
	If ib3d_KeyDown(EKEY_NUMPAD2) Then ib3d_MoveEntity(cam2,0,0,-1)
	
	If ib3d_KeyDown(EKEY_LEFT) Then ib3d_TurnEntity(cam2,0,-1,0)
	If ib3d_KeyDown(EKEY_RIGHT) Then ib3d_TurnEntity(cam2,0,1,0)
	If ib3d_KeyDown(EKEY_UP) Then ib3d_TurnEntity(cam2,1,0,0)
	If ib3d_KeyDown(EKEY_DOWN) Then ib3d_TurnEntity(cam2,-1,0,0)
	If ib3d_KeyDown(EKEY_SPACE) Then ib3d_TurnEntity(cam2,0,0,1)

	If ib3d_KeyDown(EKEY_KEY_Y) Then ib3d_TrackEntity(cam2)

	ib3d_CameraZoom(cam,zoom)
	ib3d_RenderWorld()
Wend

ib3d_FreeEntity(syd)
ib3d_EndGraphics()



Braincell(Posted 2005) [#2]
no it wont be exact. there are definately things it wont be able to do, but there will also be a lot of things it can do that you werent able to do in B3D.


What will it be able to do that b3d cannot do?
What will it be unable to do that b3d can do?

Great stuff, keep it up. I am yet to get my copy of BlitzMax tho.


slenkar(Posted 2005) [#3]
thanks Gman much appreciated, but sorry I dont own blitzmax yet,


Leiden(Posted 2005) [#4]
The ib3d_ prefix can be a little annoying. Sounds like this is gonna rock! Look forward to see it progress ;)


Vectrex(Posted 2005) [#5]
great! But yes is there really a need for the ib3d_ prefix? Since that's the whole point of the framework command and you wouldn't be using 2 3d engines at the same time.
I know you said it should be like b3d but wouldn't it be much nicer to do
cam.position(x,y,z)
rather than
PositionEntity(cam,x,y,z)?
Plus it's much more in tune with BlitzMax and BLIDE would be able to give you a nice list of functions when you type 'cam.'
I'm a teacher teaching BlitzMax so a simplifed version of irrlicht would be great (I'm using Dreide which is too simple at the moment), but either way I'd like to test it ASAP :)
email is a gmail.com one (prefix octamed :D)


gman(Posted 2005) [#6]
@Lenn - i will try to detail a list for you when i get a bit more time.

@Leiden & Vectrex - thx for the prefix suggestion :) based on the reaction i got after the initial release of the Irrlicht mods im pretty sure noone likes prefixes :) but its just the way i do things and probably wont change.

@Vectrex - underneath is an OOP core. for every function there is a corrosponding method on a type so there already is a cam.setPostion(). the ib3d_ functions are simply wrappers for the method calls that you really wouldnt even need to call if you didnt want too. in the end all the Types will be documented (hopefully a little better than what i did in the 3Impact mod). for the overall general design philosophy of the IrrB3D mod, you can check out the advanced topics section in the 3Impact mod online help docs (in the post about it). i modelled the design after how i did that one. will be sure to get you the goods when its ready :)


Jan_(Posted 2005) [#7]
hiho,

need help?
i alredy started the same mod,
but it is not as far as yours.
And 2 mods, we don't need.

cu


gman(Posted 2005) [#8]
@Jan_ - check your email :)

@Vectrex - BTW, i still have my Vectrex :)


Haramanai(Posted 2005) [#9]
Always good news to hear news from you.
I am looking forward to see some of the code especialy the code for turnentity and moveentity.

Keep the good work. You make us hapy:)

edit : I will test but I don't have b3d expirience. I will use the b3d demo to check the compartibility.
But I am using IrrBMax for some time now.


Gabriel(Posted 2005) [#10]
I'd be happy to help you test.


AntonyWells(Posted 2005) [#11]
I'll help test if you like. Will it have tform commands like blitz? That nearly always makes or breaks a 3d engine for me.


gman(Posted 2005) [#12]
@everyone - getting some great response here. very exciting, just hope i dont disappoint :)

@Haramanai - glad i can bring a little joy :)

@Antony - i have not converted those yet, but they look like vector math stuff. Irrlicht has some pretty good methods for that kind of thing so i dont forsee a conversion problem on those.

as for progress, im opening up a worklog on this one...


Leiden(Posted 2005) [#13]
Go gman, your rockin with the wrapper stuff! Any plans on what your gonna do next? Takin a look at the code above this looks like an almost code perfect compatibility with Blitz3D!


gman(Posted 2005) [#14]
happy saturday everyone. collisions took me about 3 weeks longer than i wanted and there is still a lot missing (from the B3D API), but there is still much that can be tested too. because of this i decided to release a pre-alpha mod (no source yet). you can find info about it in the worklog. comments/bugs would be much appreciated. there are still some major areas not yet complete (picking, terrain, sprites, animation, brush application). there is a rough API document link in the worklog as well as a sample program to get you started.


gman(Posted 2005) [#15]
EDIT: double post


AdrianT(Posted 2005) [#16]
So how does coldet compare to opcode for collisions.

In the B3d loader for torque our programmer settled with opcode, (the one used in the newer ODE) and it seems pretty decent with support for instances.

Anyway, look forward to see what kinds of things people produce with the irlicht bmax extension :)


gman(Posted 2005) [#17]
havent had a lot of time lately... i posted a new pre-alpha version available in the worklog. this time with source.