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?

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?

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?