Animating the Object on touch_DOWN & Stopping on touch_UP

Started by sushobhit, February 09, 2014, 10:56:52 AM

Previous topic - Next topic

sushobhit

Hi friends ,
Really grateful to jpct. It's really wonderful. First let intro myself . I am quite well oriented with software & web programming but have little experience in 3d modeling & softwares eg: max || maya || bender. I downloaded some free models from tt3dm to experiment with jpct-ae engine and after 1 week of time I think I have got well versed with the engine.
My problem is I don't know how to animate the objects inside the engine.

Eg : I have a boy model now how can I make him to move his legs when the user presse TOUCH_DOWN event & stop the movement on TOUCH_UP. how do I use object.animate(xxx,xxx) event how does it works very basic/ :o

EgonOlsen

To animate an model, it has to have animations. Out of the box, jPCT supports keyframe animation from md2 files. If you have those, then just set a flag in your touch event listener and call animated in onDrawFrame with some index that counts up by some small amount in each iteration...similar to what can be found in the advanced example here: http://www.jpct.net/wiki/index.php/Advanced_example#The_game_logic

sushobhit

Thank you Mr Olsen for such a quick reply i appreciate your activeness.
Can you provide me a link from where I can get so sample MD2 Models with keyframes so that I get something to start with.
Also , I am already heavy blitting(displaying joystick controls) in onDrawFrame so would it be efficent to animate the object from there. Is there also some other way
:o

EgonOlsen

Isn't there some download link in the wiki in the context of the advanced example? It should include some md2 model as well.
If that's not sufficient, please post again with more details on what you need. I have hundreds of md2s, but i can't upload them all.