Loading animations?

I’m looking for information on how to load a model and animations for my game. I need a soldier with animations such as run, grenade, shoot, etc. Obviously I’ll start off with something simpler, but that’s my ultimate goal.

I’m new to this so I’m wondering what format models I should use and if there are any free modeling programs I can use to make models that will load easily. Basically any information to help me get started with adding animated models to my game. Thanks!

I’ve the same goals, so I can sure advice you.

I think MD2 format is the most adapted.
Because :

  • Some free modelers have MD2 support ( almost export )
  • Xith3D has a MD2 loader ( newdawn )
  • You can only have frame animations, but you can export bones animations to frame animations.

So you can look in the Xith toolkit, where you will find the loader.
The example programs are very clear and “enlighting” ( as long as the enlighted nodes are child of the light :slight_smile: );

Great, very helpful thanks. Any suggestions on which modeling programs I can use? Hopefully there are some good free ones out there.

Well, some news that can interest you.

I found MD2 good, but I also found better…

Cal3D is a free animation character library written in C++.
The bad news is : It’s in C++, so we can’t use it.
The good news is : The author of Fuze3D have made a pure Java port of Cal3D.

Cal3D have it own file format, and it support :

  • All kind of interpolations you want
  • Animation blending so you can make a character walk and fire at the same time without creating a specific animation
  • Detail control : you can set it to a lower level if your character is far : So it speed up the game.
  • Bone animation
  • Import from 3DS Max and Blender !

So I’m intending to adapt Cal3D for Xith3D and to integrate it in Gamma ( http://gamma.dev.java.net ).

So, if you’re interested, just wait I’ve done it…
And if someone want to help me, it would be appreciated ( arne ? ).

bluesky,
I’d better get gamma running first :wink: - I’ve put a question in the gamma forums (in java.net) the other isn’t ready yet, right ? There you’ll see why it doesn’t work for me.

You’re right.
I answered your question in Gamma forums ( dev.java.net, and yes the other is not yet ready ).
But actually Gamma is rewritten in part, so you can see the changes over the weeks.

I finally got a chance to check out the newdawn MD2 loader… looks pretty easy to use although there are some compilation errors:


java.lang.Error: Unresolved compilation problems: 
	BranchGroup.ALLOW_CHILDREN_READ cannot be resolved
	BranchGroup.ALLOW_CHILDREN_EXTEND cannot be resolved
	BranchGroup.ALLOW_CHILDREN_WRITE cannot be resolved

	at org.newdawn.xith3d.loaders.md2.MD2ModelInstance.<init>(MD2ModelInstance.java:72)
	at org.newdawn.xith3d.loaders.md2.MD2Model.getInstance(MD2Model.java:101)
	at MD2Test.loadModel(MD2Test.java:200)
	at MD2Test.<init>(MD2Test.java:117)
	at MD2Test.main(MD2Test.java:275)
Exception in thread "main" 

I don’t seem to have a definition for those BranchGroup constants? Can anyone give me information on how to resolve? Thanks!

Yeah, its not been updated since Xith removed all its Java3D compatibility.

Just remove any references to those constants.

Kev

Infact, I’ve just done it for you… download the new version from http://www.newdawnsoftware.com

Kev

Thanks kev, this loader rocks! Although I do have a question. I’m using Milkshape 3d, I just started learning it. There doesn’t appear to be a way to save multiple animations in one .md2 file. It appears in your example with the alien you call both the run and stand animations from the same file, how is this possible? Am I missing something or do I need to find a better modeling program?

MD2 supports a series of frames. In standard MD2 the frame indices are arranged into groups which Quake 2 used (run, idle, attck… etc). You should be able to label each frame with a different animation name.

Kev