Topic: animation functions?

Im very much enjoying trying out this excellent mod but am wondering what options do i have for animating meshes.
Do i have all the anims in the mesh and then run it? I don't see a extractanimseq, loadanimseq or addanimseq, animate etc?

Re: animation functions?

greetings smile  in Irrlicht, animating is built into all the models formats capable of it and exposed via a common AnimateMD2-style format.  unfortunately i have not yet gotten to those functions...  animating models is there now, you will just need to do it Irrlicht's way at the moment.  i will see if i can get an example for you.  in the meantime you can take a peek at the IAnimatedMeshSceneNode interface of Irrlicht for more information.

Re: animation functions?

thankyou for the quick reply, i will look into that, just trying to get my head around irrlicht.
Is it possible to load animation to sequences in irrlicht like you could in blitz3d to an animated mesh?

Re: animation functions?

Think it's abit over my head just yet :-)
I can use non-animated placeholders for now.

Re: animation functions?

here is a simple setup.  this uses the sydney model from the irrlicht demos.  i listed a few animation functions right above the game loop:

SuperStrict 
Framework Irrlicht.B3D

ib3d_Graphics3D(640,480)
Local cam:CAMERA=ib3d_CreateCamera()
ib3d_PositionEntity(cam,80,30,30)

Local syd:MESH=ib3d_LoadAnimMesh("sydney.md2")
Local tex:TEXTURE=ib3d_LoadTexture("sydney.bmp")
ib3d_EntityTexture(syd,tex)
ib3d_PositionEntity(syd,10,0,30)

Local LIGHT:LIGHT=ib3d_CreateLight()

ib3d_CameraClsColor(0,0,0)
ib3d_EntityDebugDataVisible(syd,True)
ib3d_NameEntity(syd,"SYD")
ib3d_NameEntity(cam,"CAM")

ib3d_EntityRadius(cam,30)
ib3d_EntityOffset(cam,0,10,0)
ib3d_EntityType(cam,1)
ib3d_EntityType(syd,2)
ib3d_EntityType(syd,1)

Local done:Int=False 
Local current:Int=0

Local zoom:Float=1.0
Local controlled:ib3d_Entity=cam
Local projmode:Int=1
Local cnt:Int=0

Local cube:PRIMITIVE=ib3d_CreateCube()
ib3d_PositionEntity(cube,10,80,30)
'ib3d_EntityPickMode(cube,PM_BOX)
ib3d_NameEntity(cube,"CUBE")

Local sphere:PRIMITIVE=ib3d_CreateSphere()
ib3d_EntityPickMode(sphere,PM_BOX)
ib3d_PositionEntity(sphere,10,125,30)
ib3d_NameEntity(sphere,"SPHERE")

Local speed:Float=.05

ib3d_PointEntity(cam,sphere)

Local fnt:FONT=ib3d_LoadImageFont("fonthaettenschweiler.bmp",18)
ib3d_SetImageFont(fnt)
ib3d_SetFontColor(255,0,0)

'------
' animation functions
IAnimatedMeshSceneNode(syd._node).getFrameNr() ' returns current frame
IAnimatedMeshSceneNode(syd._node).setAnimationSpeed(25) ' sets speed of animation
Local startframe:Int=0, endframe:Int=25
IAnimatedMeshSceneNode(syd._node).setFrameLoop(startframe,endframe) 'sets the start and end frames
IAnimatedMeshSceneNode(syd._node).setLoopMode(False) ' to turn off looping
'------

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_LEFT) Then ib3d_TurnEntity(controlled,0,-speed,0)
    If ib3d_KeyDown(EKEY_RIGHT) Then ib3d_TurnEntity(controlled,0,speed,0)
    If ib3d_KeyDown(EKEY_UP) Then ib3d_TurnEntity(controlled,speed,0,0)
    If ib3d_KeyDown(EKEY_DOWN) Then ib3d_TurnEntity(controlled,-speed,0,0)
    If ib3d_KeyDown(EKEY_SPACE) Then ib3d_TurnEntity(controlled,0,0,speed)
    If ib3d_KeyDown(EKEY_NUMPAD9) Then ib3d_MoveEntity(controlled,0,speed,0)
    If ib3d_KeyDown(EKEY_NUMPAD3) Then ib3d_MoveEntity(controlled,0,-speed,0)
    If ib3d_KeyDown(EKEY_NUMPAD6) Then ib3d_MoveEntity(controlled,speed,0,0)
    If ib3d_KeyDown(EKEY_NUMPAD4) Then ib3d_MoveEntity(controlled,-speed,0,0)
    If ib3d_KeyDown(EKEY_NUMPAD8) Then ib3d_MoveEntity(controlled,0,0,speed)
    If ib3d_KeyDown(EKEY_NUMPAD2) Then ib3d_MoveEntity(controlled,0,0,-speed)
    If ib3d_KeyDown(EKEY_KEY_U) Then ib3d_TurnEntity(controlled,0,0,-speed)
    If ib3d_KeyDown(EKEY_KEY_Y) Then ib3d_TurnEntity(controlled,0,0,speed)
    
    If ib3d_KeyDown(EKEY_KEY_T) Then ib3d_TrackEntity(cam)
    'If ib3d_KeyHit(EKEY_KEY_V) Then ib3d_PointEntity(cam,syd)
    'If ib3d_KeyDown(EKEY_KEY_V) Then ib3d_PointEntity(syd,cam)
    'If ib3d_KeyDown(EKEY_KEY_V) Then ib3d_PointEntity(syd,cube)
    If ib3d_KeyDown(EKEY_KEY_V) Then ib3d_PointEntity(syd,sphere)

    If ib3d_KeyHit(EKEY_KEY_O) Then
        If projmode=1 Then projmode=2 Else projmode=1
        ib3d_CameraProjMode(cam,projmode)
    EndIf

    Local picked:ib3d_Entity=ib3d_EntityPick(syd)

    If picked Then 
        DebugLog(MilliSecs()+" | "+ib3d_EntityName(picked))
    EndIf

    If ib3d_KeyHit(EKEY_KEY_C) Then 
        If current=0 Then 
            current=1 
            controlled=syd
        Else 
            current=0
            controlled=cam
        EndIf
    EndIf

    ib3d_DrawText("This is my test text",10,10)
    ib3d_DrawLine3df(ib3d_LastPickRay(),255,0,0)
    ib3d_DrawTriangle3df(ib3d_PickedTriangle(),255,0,0)
                
    ib3d_UpdateWorld()
    ib3d_RenderWorld()
    
    cnt:+1    
Wend

ib3d_FreeEntity(syd)
ib3d_EndGraphics()

Re: animation functions?

Thanks, that should set me on my way :-)