Extracting animations from B3D?
Blitz3D Forums/Blitz3D Beginners Area/Extracting animations from B3D?
| ||
| Hey guys, I'm working on learning the basics of Blitz3d using this mesh file: www.psionic3d.co.uk/gallery/albums/uploads/Free%20Stuff/3D%20Models/ninja.zip What I'm wondering now is how to trigger the animations inside of this file. Right now my code, using B3D SDK, looks something like this:
BBEntity Player = bbLoadAnimMesh("ninja/ninja.b3d");
bbEntityTexture(Player,ninjaBlue);
//walking animation
bbExtractAnimSeq(Player,1,14,0);
//jumping animation
bbExtractAnimSeq(Player,94,102,1);
while(!bbKeyHit(Key_Escape))
{
bbCls();
if(bbKeyHit(Key_Up))
{
// play walking forward animation
bbAnimate(Player,1,0.25,1);
}
if(bbKeyHit(Key_Down))
{
// play the walking animation in reverse
bbAnimate(Player,1,-0.25,1);
}
if(bbKeyHit(Key_Space))
{
// jump!
bbAnimate(Player,1,0.25,2);
}
// if no keys are hit, turn off the animation
if(!bbKeyDown(Key_Up) && !bbKeyDown(Key_Down) && !bbKeyDown(Key_Left) && !bbKeyDown(Key_Right)&& !bbKeyDown(Key_Space))
{
bbAnimate(Player,0,0.25,1);
}
bbUpdateWorld();
bbRenderWorld();
bbFlip();
}
The walking animations are OK for the time being. I can't get my damn ninja to jump though :( Can anyone please point out what is going wrong here? |
| ||
| I'm not sure what is wrong, however I remebered seeing this code, which I thought could be helpful for this: http://www.blitzbasic.com/codearcs/codearcs.php?code=660 |
| ||
| Excellent! Thank you! |