Jump to content
  • Advertisement
Sign in to follow this  
CastorX

multiple anims in .x

This topic is 4338 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi! I'm working on my (very simple) game engine. Now comes the animation and my question is how can I create two or more animations sequences like running, shooting, standing with Maya? I don't know how can I do it. (There's only one timeline... or what?) Bye!

Share this post


Link to post
Share on other sites
Advertisement
I know absolutely nothing about Maya, but the general idea (that I've learnt from writing a couple of model loaders) is that you have a number of frames. You'll use the first, say, 10 frames for a walking animation that you can loop over and over, the next 15 for something else, the next 13 for something else, etc, etc.

Then, there'll be a section of the file format which will have a list of animations, so, 0-10, 11-25, 26-38, etc.

Of course, unless you have a set of models for a specific game which will all have frame 0-10 for walking, 11-25 for something else, etc, etc, you'll have to write a little text readme file and list all of the animations and their frames there.

Share this post


Link to post
Share on other sites
In .x files there are what are called AnimationSets. Each distinct animation can be put into a separate animation set and given a unique name to use it. So in the .x file it would look like:

AnimationSet Run
{
Run animnation matrix transformations
}

AnimationSet Idle
{
Idle animation matrix transformations
}

etc..

And to use the animation sets here is a little example(in C#, but you can get the idea) from my animation class:
Quote:

AnimationSet aniSet = rootFrame.AnimationController.GetAnimationSet("Run");
rootFrame.AnimationController.SetTrackAnimationSet(0, aniSet);


I know if you import a .x with animation into FragMotion, you can see the different animation sets. You can also create animations in FragMotion. I'm not sure how to do it in Maya. I had some free .x files with animations in them that I had to manually copy and paste the transformations into their own AnimationSets so that it was not looping through every animation in the file.

Share this post


Link to post
Share on other sites
I'm not a Maya user but...

I don't mean to sound rude, but make no mistake that skinned meshes are easy to implement. Using the DirectX .X model format is hell, even when you use DX functions to parse the files! Animations sets, animation controllers, mesh containers - it get's really complicated...ESPECIALLY if you want to display the same mesh with different animations at the same time.

A simpler form of animation that is best suited toward simple game engines is called "morph-target" animations, which are basically keyframes (stored as individual meshes) that are morphed into each other, creating a fairly convincing animation. The old Quake games used them (Quake I and III I believe...maybe II). It's easy to implement with a cool feature in Direct3D called "tweening". This also allows you to create things like a waving flag or simple waves, which are difficult or impossible with skinned (skeletal) animations. I belive gamedev.net has an article on tweening (maybe it was devmaster.net?).

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!