3D Keyframe Animation

Anything libgdx related goes here!

3D Keyframe Animation

Postby wmdAndrew » Wed Aug 24, 2011 12:45 am

I'm wondering if anyone has some advice on 3D keyframed animation within libgdx. I'm making a 3D application on Android. I made an MD5 file that dropped my frame rate 20 fps on my target device (Moto flagship Droid). I read Dave's post on how keyframe significantly increases performance here:

http://www.badlogicgames.com/wordpress/?p=1365

And this is where I'm at :) My partner and I are thinking MD2, but I know there has been issues with exporters (I've already ran into some with obj and MD5 formats).

So my questions are:

1. what do you use to do animations
2. what exporter do you use
3. if it's something not in the Tests (like the sampleAnimationFromMD5() method mentioned in Dave's post) would you mind sharing your code :)

We have a fully functional game right now with static .obj files. Just looking to snaz it up with some animation :D

Thanks!
Did you find my post helpful? If you want to help me in return please download and provide feedback for Scrap Metal Mech Feedback can be posted on our Scrap Metal Mech Show Case thread
wmdAndrew
 
Posts: 65
Joined: Tue Aug 23, 2011 11:55 pm

Re: 3D Keyframe Animation

Postby radioking » Wed Aug 24, 2011 2:51 pm

Maybe you can find some information in our community wiki, e.g. on these pages:

http://code.google.com/p/libgdx-users/w ... axAndBones
http://code.google.com/p/libgdx-users/w ... romBlender

You could help to contribute to these pages in the progress:

http://code.google.com/p/libgdx-users/w ... eFormatMd2
http://code.google.com/p/libgdx-users/wiki/animation
http://code.google.com/p/libgdx-users/w ... eFormatMd5


just PM me your Gmail address and I will add you as contributor
Please "give sth. back" to community and contribute your knowledge to our libgdx-users project community wiki:
http://code.google.com/p/libgdx-users/
Please see Mario's note on User Wiki 2.0: http://www.badlogicgames.com/wordpress/?p=2411
radioking
 
Posts: 284
Joined: Wed Aug 03, 2011 10:28 am

Re: 3D Keyframe Animation

Postby wmdAndrew » Fri Aug 26, 2011 2:10 am

I'll be sure to post once I get things figured out. I sent an email to be added.

But I was really hoping to get some advice. I see some pretty cool youtube videos of libgdx animation.
Did you find my post helpful? If you want to help me in return please download and provide feedback for Scrap Metal Mech Feedback can be posted on our Scrap Metal Mech Show Case thread
wmdAndrew
 
Posts: 65
Joined: Tue Aug 23, 2011 11:55 pm

Re: 3D Keyframe Animation

Postby wmdAndrew » Sat Sep 24, 2011 9:58 pm

Background:
My partner and I are created a Mech game called "Scrap Metal Mech." We're both coders not 3D artists. The multimedia has fallen to my though as I am slightly more artistic (I know how to get around on PhotoShop :P). This has been an adventure. I hope this will help you out (maybe when I get done I'll write something up in the wiki/forum tutorial).

Solution So Far:
Thought I would update this. I tried doing g3d but couldn't find an exporter for blender on Blender 2.5 (that worked with animated models). The one in libgdx source seems to only do still models.

I have successfully made an MD2 animated file and have it running in libgdx. Here is the blender script I use to export:

http://groups.google.com/group/junaio-developer/browse_thread/thread/f4d51a48fe55dbcc?pli=1

I did have to run the script manually as described by the last poster.

In order to get MD2 working with the model-loader tests you will need to uncomment lines 63, 64, and of course 190 in the KeyframedModelViewer.java file

Code: Select all
Material material = new Material("material", new TextureAttribute(texture, 0, "s_tex"));
model.setMaterial(material);
...
new JoglApplication(new KeyframedModelViewer("data/knight.md2", "data/knight.jpg"), "KeframedModel Viewer", 800, 480, false);


Animation:
I actually built the 3D mesh in a program called Art of Illusion. It's not that great for anything else. I then textured in Wings3D. I did this a long time ago so I don't remember if I had any tutorials I could pass along.

Once I came to animation I pretty much only had Blender (with my $0 budget). Here are the tutorials I used (watched them so many times I could almost recite them):

Armatures (skeleton) used for animation:
http://www.cgmasters.net/free-tutorials/blenders-armatured-a-crash-course/

Animation:
http://vimeo.com/15679442

Observations:
G3D is a very obscure file format. G3D also turns up a ton of things in Google.

The MD2 file I made is only about 40kb. On the milestone Moto Droid we have the game running at 42 fps with two separate md2 objects animating. My Droid X2 of course renders this without any problem.

The MD2 exporter required 1 mesh to export. Since we're doing a mech game and I had each item separated out this caused me some issue.

Enjoy!
Did you find my post helpful? If you want to help me in return please download and provide feedback for Scrap Metal Mech Feedback can be posted on our Scrap Metal Mech Show Case thread
wmdAndrew
 
Posts: 65
Joined: Tue Aug 23, 2011 11:55 pm

Re: 3D Keyframe Animation

Postby radioking » Mon Sep 26, 2011 7:20 pm

Hi wmdAndrew,

I added you to libgdx-users project as contributor a couple of days ago, I think.

You could add your findings to wiki to keep it all together in it's proper place
and post a link to your community-wiki-page here.
Please "give sth. back" to community and contribute your knowledge to our libgdx-users project community wiki:
http://code.google.com/p/libgdx-users/
Please see Mario's note on User Wiki 2.0: http://www.badlogicgames.com/wordpress/?p=2411
radioking
 
Posts: 284
Joined: Wed Aug 03, 2011 10:28 am

Re: 3D Keyframe Animation

Postby wmdAndrew » Tue Sep 27, 2011 2:29 am

Alright we have it running great in our game. Had a little issue with textures and my partner realized it was drawing in clockwise order.

Here is the rough Wiki Page (under advanced tutorials):

http://code.google.com/p/libgdx-users/wiki/MD2_Keyframe_Animation
Did you find my post helpful? If you want to help me in return please download and provide feedback for Scrap Metal Mech Feedback can be posted on our Scrap Metal Mech Show Case thread
wmdAndrew
 
Posts: 65
Joined: Tue Aug 23, 2011 11:55 pm

Re: 3D Keyframe Animation

Postby radioking » Tue Sep 27, 2011 10:08 am

Looks good, thanks for contribution! :)
This way questions on this can be answered by posting just the link to that page.
Please "give sth. back" to community and contribute your knowledge to our libgdx-users project community wiki:
http://code.google.com/p/libgdx-users/
Please see Mario's note on User Wiki 2.0: http://www.badlogicgames.com/wordpress/?p=2411
radioking
 
Posts: 284
Joined: Wed Aug 03, 2011 10:28 am


Return to Libgdx

Who is online

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