Author Topic: Animating the Object on touch_DOWN & Stopping on touch_UP  (Read 2507 times)

Offline sushobhit

  • long
  • ***
  • Posts: 109
  • future is now
    • View Profile
    • ANDROID APPS
Animating the Object on touch_DOWN & Stopping on touch_UP
« on: February 09, 2014, 10:56:52 am »
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

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Animating the Object on touch_DOWN & Stopping on touch_UP
« Reply #1 on: February 09, 2014, 12:29:20 pm »
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

Offline sushobhit

  • long
  • ***
  • Posts: 109
  • future is now
    • View Profile
    • ANDROID APPS
Re: Animating the Object on touch_DOWN & Stopping on touch_UP
« Reply #2 on: February 09, 2014, 01:26:14 pm »
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

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Animating the Object on touch_DOWN & Stopping on touch_UP
« Reply #3 on: February 11, 2014, 11:37:04 pm »
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.