Hello all,
I have a .x object with a simple animation, but when I load it in Blitz, I get an error message saying Entity has no animation attached! Does anyone know how I can load the animation within the object? Here's my code:
AppTitle "Object Animation Test"
Graphics3D 800,600
SetBuffer BackBuffer()
cam = CreateCamera()
PositionEntity cam,0,1,0
;create a background
bg = LoadImage("level1_sky.jpg")
CameraClsMode cam,False,True
p = CreatePlane()
PositionEntity p,0,0,0
pt = LoadTexture("Materi1.jpg")
EntityTexture p,pt
snowman = LoadMesh("snowman_anim.x")
PositionEntity snowman, 0,1,0
DrawImage bg,0,0
UpdateWorld
RenderWorld
Flip
While Not KeyDown (1)
;load animation from file
Text 0,0,Str(LoadAnimSeq(snowman,"snowman_anim.x"))
Flip
WaitKey
End
Animate snowman,1
If KeyDown(200) ;up
MoveEntity cam,0,0,1
End If
If KeyDown(203) ;left
TurnEntity cam,0,1,0
End If
If KeyDown(208) ;down
MoveEntity cam,0,0,-1
End If
If KeyDown(205) ;right
TurnEntity cam,0,-1,0
End If
DrawImage bg,0,0
UpdateWorld
RenderWorld
Flip
Wend
End
|