How to call several animations seperatly in single model

Forum for discussion on 3D games for mobile platform and doubts related to M3G, Mascot capsule and other rendering engines.

How to call several animations seperatly in single model

Postby prasadmathugama » Tue May 04, 2010 8:16 am

I am developing a mobile 3d cricket game. I want several shots assigned to my batsman. It can easily done by 3d max and then convert it to m3g file format. But the problem occurs here is when i need to call each animations separately for each key events, I can't use animate(). So what I am currently doing is making separate models for each actions and call them when needed. But that creates several m3g files for each object and some loading efficient problems. Can some one help me on calling each actions separately in single object...???
prasadmathugama
 
Posts: 4
Joined: Tue May 04, 2010 8:02 am

Re: How to call several animations seperatly in single model

Postby ladty » Thu Jul 29, 2010 12:40 pm

why couldn't you use animate()? It's done simply by animate(animTime); -> you just haave to know, where your animation starts and where it ends. If you want to run an animation which starts at frame 50, set animTime to 50 and in each frame do animTime++ (or +=5 if it's to slow etc.). And in the end of this animation, just stop incrementing animTime or jump to another animation (animTime=25). It's quite simle, just write few functions for it, store your keyframes in some array (int[] keyFrames={0, 25, 50, 100, 140};) and than call your function startAnim(ANIMATION_RUNNING) -> animTime=keyFrames[ANIMATION_RUNNING];
Hope it helped
User avatar
ladty
 
Posts: 24
Joined: Wed Jul 09, 2008 10:36 am
Location: Czech republic


Return to 3D Mobile Game (M3G)

Who is online

Users browsing this forum: Exabot [Bot] and 1 guest

cron