1 (edited by vectrex 2006-02-02 09:31:56)

Topic: IrrB3D?

Howdy gman, just wondering if the b3d mod is usable at the moment (and where to get the latest). I notice it's not mentioned anywhere here.
I'm a teacher teaching basic games programming so it looks ideal really (I'd probably teach the oop function calls though).
Just trying to decide what to teach, last year I used that DriDe engine which was... ok, just.. it had nice and easy syntax but was pretty dodgy. So now I want to jazz it up a bit. The full irrlicht mod is WAY to complex for the students big_smile The 3impact mod looks pretty good but still a little too complex. So it's 3impact or irrB3D. The main thing in 3impacts favour is the built in physics.
Is there anyway to get basic physics in irrB3D? maybe through the newton mod?

Re: IrrB3D?

vectrex wrote:

Howdy gman, just wondering if the b3d mod is usable at the moment (and where to get the latest). I notice it's not mentioned anywhere here.

greetings vectrex smile  gg.IrrB3D still exists though with my current workload i havent been able to work on.  you can download the latest here:

2005_12_05 gg.IrrB3D Mod Pre-Alpha

vectrex wrote:

I'm a teacher teaching basic games programming so it looks ideal really (I'd probably teach the oop function calls though).

actually i would recommend that.  todays world is ever OOP oriented and it would be starting them off on the right foot.

vectrex wrote:

The full irrlicht mod is WAY to complex for the students big_smile

i would agree that the full mod is overwhelming.  i think you could definately pull out the major components and abstract it into concepts.  how deep does your class get or what is the topic?

vectrex wrote:

The 3impact mod looks pretty good but still a little too complex.

i would agree that 3Impact may not be the best choice.  while a good API in many respects, i think they would get more out of the Irrlicht mods.

vectrex wrote:

So it's 3impact or irrB3D. The main thing in 3impacts favour is the built in physics.
Is there anyway to get basic physics in irrB3D? maybe through the newton mod?

although incomplete, you could definately use some of the niceties of IrrB3D.  it wraps up some of the more difficult aspects of getting a game framework going such as collision support and input.  depends on how deep your class is but IrrB3D may handle all you need.  as for physics, when i designed the collision system i examined physics libraries and tried to plan ahead.  although it is not there yet, it can be done by extending the base collision types and implementing the newton calls.  unfortunately that would probably be a little much for the students sad

unfortunately i have about a gazillion things going on right now, but id be happy to help in any way i can.

3 (edited by vectrex 2006-02-03 09:00:41)

Re: IrrB3D?

thanks for your support. My class is actually 2 classes of different years. First years are dead basic, very little programming experience (one very basic java class), as long as they can get stuff happening on screen and make something you could call a game they'll pass smile So collision and mesh loading exported from 3dsMax are about the minimum. 2nd year class I would like to get them to either use physics and/or make a simple networked multiplayer game so I think that should be possible in blitz with irrB3D. If it's possible to get actual collision with bsp or trimesh collision that would be nice.
I use Newton with the Ogre engine in C++ myself and the trimesh collision for scenery and convex hull for everything else is just SO easy and fast it's scary smile I use 'OgreNewt' as the integration to the ogre engine and it's really simple to set up physics. So I'm hoping I can get that ease while avoiding c++ like the plague wink
Anyway I'll check irrB3D out properly in the next few days. Can't be worse than DriDE wink Pity he gave up on that really, the main problem is some things just didn't work or were buggy.

4 (edited by vectrex 2006-02-19 09:25:07)

Re: IrrB3D?

back again. So I'm going to use irrB3D for the class smile A few things, how does collision work? I've never used blitz3d, is it like that? There seems to be loads of collision functions, which seems a bit unnessesary. Which ones are the minimum needed? Newton would be nice to get going for sure as in c++ and OGRE all I need to do is set the world to trimesh and everything else as convexhulls and setup a few simple callbacks.
Also I assume mesh animation isn't implemented? I can use direct irrlicht for the time being so I might make a simple function for the students so they don't have to look at raw irrlicht and get scared wink

Also what format do you recommend exporting from MAX for stuff like scenes? Can individual objects/properties be accessed in any format? I'm used to OGRE with it .scene xml format. Collada is similar but have never really used irrlicht's version.

Re: IrrB3D?

I agree with Gman on this you should probebly use the irrlicht module, teach those kids OOP straight away wish I learned it when I was younger

Re: IrrB3D?

vectrex wrote:

back again. So I'm going to use irrB3D for the class smile A few things, how does collision work?  I've never used blitz3d, is it like that?

very similar yes.  i will see if i can whip up a quick example for you either tonight or tomorrow night.

vectrex wrote:

There seems to be loads of collision functions, which seems a bit unnessesary. Which ones are the minimum needed?

ib3d_EntityType() - defines the collision type for an entity
ib3d_Collisions() - sets up checking for collisions between two types
ib3d_CountCollisions(entity) - checks how many collisions occurred for this entity
ib3d_CollisionX(), ib3d_CollisionY(), ib3d_CollisionZ()

all these were modelled after their B3D counterparts with a few attempted improvements.

vectrex wrote:

Also I assume mesh animation isn't implemented? I can use direct irrlicht for the time being so I might make a simple function for the students so they don't have to look at raw irrlicht and get scared wink

correct.  use direct Irrlicht for animation.

vectrex wrote:

Also what format do you recommend exporting from MAX for stuff like scenes? Can individual objects/properties be accessed in any format? I'm used to OGRE with it .scene xml format. Collada is similar but have never really used irrlicht's version.

not sure on that one sad  check out the Irrlicht documentation on the supported formats and see if any of those have what you need.

Re: IrrB3D?

here is a sample program for you.  it will detect collisions between the camera (which has an invisible sphere around it) and 2 sydney models.  when the camera collides, it will draw a white box at the point of collision.

Strict 
Framework gg.IrrB3D

ib3d_Graphics3D(640,480)

Local cam2:CAMERA=ib3d_CreateCamera()
ib3d_PositionEntity(cam2,30,30,30)

Local syd:MESH=ib3d_LoadAnimMesh("sydney.md2")
Local syd2:MESH=ib3d_LoadAnimMesh("sydney.md2")

ib3d_EntityTexture(syd,ib3d_LoadTexture("sydney.bmp"))
ib3d_EntityTexture(syd2,ib3d_LoadTexture("sydney.bmp"))

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

' NOTE, if no light, need to set EMF_LIGHTING to false in order to show up
'syd._node.setMaterialFlag(EMF_LIGHTING,True)

' animation support is not there yet so reverting to Irrlicht by casting the internal _node pointer
T_irrIAnimatedMeshSceneNode(syd._node).setFrameLoop(0,320)
T_irrIAnimatedMeshSceneNode(syd._node).setAnimationSpeed(30)
T_irrIAnimatedMeshSceneNode(syd2._node).setFrameLoop(0,320)
T_irrIAnimatedMeshSceneNode(syd2._node).setAnimationSpeed(30)

ib3d_CameraClsColor(200,200,200)

ib3d_ShadowColor(150,0,0,0)

ib3d_EntityDebugDataVisible(syd,True)
ib3d_EntityDebugDataVisible(syd2,True)

ib3d_NameEntity(syd,"SYD")
ib3d_NameEntity(syd2,"SYD2")
ib3d_NameEntity(cam2,"CAM2")

ib3d_AddZipFileArchive("map-20kdm2.pk3")

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

ib3d_PositionEntity(quake,-1300,-144,-1249)
ib3d_PositionEntity(syd2,ib3d_EntityX(syd),ib3d_EntityY(syd),ib3d_EntityZ(syd)+50)

' setting up some collision info
ib3d_EntityRadius(cam2,30)
ib3d_EntityOffset(cam2,0,10,0)

' setting the collision type for the entity.  each entity can have multiple types.
ib3d_EntityType(cam2,1)
ib3d_EntityType(syd,2)
ib3d_EntityType(syd,1)
ib3d_EntityType(syd2,2)
ib3d_EntityType(syd2,1)
ib3d_EntityType(quake,3)

' setup collision detection.  type 1s can collide with type 2s.
ib3d_Collisions(1,2,CD_ELLIPSOID_POLY_IRRLICHT,CR_STOP,"TEST")

' MapIncludeinCounts is specific to gg.IrrB3D.  this tells the collision system to ignore this collision detection
' when checking to see if a collision has been made.  this is mainly used for object/terrain collision.
ib3d_MapIncludeInCounts(ib3d_Collisions(1,3,CD_ELLIPSOID_POLY_STATIC_IRRLICHT,CR_SLIDE_LIMITED_IRRLICHT,"TEST2"),False)

' we are going to use a box to show where the camera is colliding.
Local box:T_irrISceneNode=_g_ib3d_engine.smgr.addTestSceneNode()
box.setPosition(T_irrVector3df.createFromVals(30,-70,60))

Local zoom:Float=1.0

While Not ib3d_KeyDown(EKEY_ESCAPE)

    ' zoom in/out
    If ib3d_KeyDown(EKEY_KEY_Z) Then zoom:+0.005
    If ib3d_KeyDown(EKEY_KEY_X) Then zoom:-0.005
    
    ' move the camera
    If ib3d_KeyDown(EKEY_NUMPAD9) Then ib3d_MoveEntity(cam2,0,50,0)
    If ib3d_KeyDown(EKEY_NUMPAD3) Then ib3d_MoveEntity(cam2,0,-50,0)
    If ib3d_KeyDown(EKEY_NUMPAD6) Then ib3d_MoveEntity(cam2,50,0,0)
    If ib3d_KeyDown(EKEY_NUMPAD4) Then ib3d_MoveEntity(cam2,-50,0,0)
    If ib3d_KeyDown(EKEY_NUMPAD8) Then ib3d_MoveEntity(cam2,0,0,50)
    If ib3d_KeyDown(EKEY_NUMPAD2) Then ib3d_MoveEntity(cam2,0,0,-50)
    
    ' turn the camera    
    If ib3d_KeyDown(EKEY_LEFT) Then ib3d_TurnEntity(cam2,0,-50,0)
    If ib3d_KeyDown(EKEY_RIGHT) Then ib3d_TurnEntity(cam2,0,50,0)
    If ib3d_KeyDown(EKEY_UP) Then ib3d_TurnEntity(cam2,50,0,0)
    If ib3d_KeyDown(EKEY_DOWN) Then ib3d_TurnEntity(cam2,-50,0,0)
    If ib3d_KeyDown(EKEY_SPACE) Then ib3d_TurnEntity(cam2,0,0,50)

    ' perform collisions and reposition entities based on collisions
    ib3d_UpdateWorld()
    ' render the current world
    ib3d_RenderWorld()
    
    ' check to see if a collision happened
    Local coltest:COLLISION=ib3d_MapGetEntityCollision(ib3d_GetTypeMapping("TEST"),cam2,0)
    ' set the box to the point of collision
    If coltest And coltest._point And coltest._point.isvalid() Then box.setPosition(T_irrVector3df.createFromVals(coltest._point.getX(),coltest._point.getY(),coltest._point.getZ()))    
Wend

ib3d_FreeEntity(syd)
ib3d_FreeEntity(syd2)

ib3d_EndGraphics()

Re: IrrB3D?

great! thanks for that.

"Local coltest:COLLISION=ib3d_MapGetEntityCollision(ib3d_GetTypeMapping("TEST"),cam2,0)"

I assume that is testing if a collision happened between the camera and anything tagged in the "test" collision map? This is the only bit that isn't obvious from the comments. The zero also I'm not sure about (the idx)

Re: IrrB3D?

0 is the collision index.  it is essentially returning the first collision in the list for cam2.  if cam2 collided with more than just one object, you can iterate through them by incrementing that index (aside from the ones filtered out because of the call to ib3d_MapIncludeInCounts()).

Re: IrrB3D?

howdy, back again. One of my students tried loading a scene with a few polys and it appears there's a limit of 65,535 polygons. Is this right? That's not many polys really, just wondering if it's a irrLicht thing or a irrB3D thing.
Also which formats do skeletal animation exported from max? Thanks!

11 (edited by vectrex 2006-03-19 18:17:54)

Re: IrrB3D?

..also does the parent/child stuff work correctly? I tried attaching the camera to an object for a 3rd person view, but even though the position was positioned ok, the view angle seems to point to a single point in space. Maybe I'm doing it wrong?

Re: IrrB3D?

vectrex wrote:

howdy, back again.

oh no! wink

vectrex wrote:

One of my students tried loading a scene with a few polys and it appears there's a limit of 65,535 polygons. Is this right? That's not many polys really, just wondering if it's a irrLicht thing or a irrB3D thing.

that limit is per model and is a limitation of Irrlicht.  there is a patch that you can run that will get you more, but it requires rebuilding of both the Irrlicht DLL and my mods.  once i get the ability to rebuild the lib file on Linux, i plan on moving my mods to the modified 32-bit indices version which will give the higher poly limit.  im already comitted to providing an upgraded version of the mods, but im not comfortable with it until i can provide the linux lib.  i have a new laptop on the way (yay tax refund!) and plan on starting off the bat with a dual boot linux/xp installation.  i would expect a move to the upgraded libs in a month or so.

vectrex wrote:

Also which formats do skeletal animation exported from max? Thanks!

MS3D and X formats have supported skeletal animation in Irrlicht so if you can export either of those you are good.  there are some quirks though so if you find yourself running into some issues check the Irrlicht forums to see if there is some info to help you along.  if working a real project i would recommend using X, as by his own admittance the author of Irrlicht is working to make X the best supported format in Irrlicht.

vectrex wrote:

..also does the parent/child stuff work correctly? I tried attaching the camera to an object for a 3rd person view, but even though the position was positioned ok, the view angle seems to point to a single point in space. Maybe I'm doing it wrong?

did you create the camera using the ib3d function or Irrlichts functions?  by default the cameras in Irrlicht look independantly of the actual rotation.  the ib3d version should make it "look" where the rotation is looking unless you have specifically set a target to look at.  i will see if i can look into this in the next few evenings.