i cant load any of my .3ds models or in fact i cant really load any of my models except .md2. . . .
and when i load the md2 model i cant animate it on key press. .. .like if i press w to run i cant make it run. . .
i tried this. . .i loaded one of the pre made model. . the ones you get with the examples. . .please any quick usefull help would be nice em working on a project nd need fast help. . . only usefull comments please. . .i searched a lot but didnt get any solution. . . thnx in advance. .
Maybe the animation speed is too slow. Try changing it. Also it is probably not a good idea to restart the animation everytime you press the key if you are trying to make your character run because the animation will never actually play. It will just keep restarting.
Maybe the animation speed is too slow. Try changing it.
the animation runs fine its just that when i press w it starts the animation and keeps playing the animation even when i let go of w, it doesnt stop . . . .
and if i press w again and hold on to it, it stops the animation and the model just slides up . . .
you get wat em tryin to say ???
any help on how i could make the animation run AND move the model only at key press???
further help would really b nice. . .
Could be a problem with your path or maybe your exporter is not working correctly.
the path is fine. . .i think its the exporter. . .but i downloaded some other models of the net, it didnt pick those up either. . .
first u need to understand what setAnimation is.
SetAnimation is not about it plays an animation when u calling it, and when u stop calling it, it stops.
No, it sets up that from which frame, to which frame should it play the animation.
So if u want to make ur character run when u press W, and stand when u not pressing anything, then u have to call the setAnimation(EMAT_RUN) when u press the W, and else, set it to EMAT_STAND.
Also setAnimation works like, sets the first, and the end frame, and sets the current frame to the start frame. So if u keep calling setAnimation in every loop, it will always move to the start frame, so it wont move.
for avoid that, u can make 2 variables, one for the previous animation, one for the next animation. Set the next animation to stand in every frame, and if pressed W then set to run, etc.
Then at the end, check if the last animation is different from the next animation, and if it is, then set the animation.
Or handle the events well (like if W is pressed, but not running yet, then run, and if nothing pressed but still not standing, then set stand, etc. but i think its much more complicated)