Bones - Skeletal and Pose animations for jPCT

Started by raft, January 06, 2010, 11:45:01 PM

Previous topic - Next topic

raft

thanks and you are welcome ;D Bones is stable and usable at the moment. you can use it as a replacement of jPCT's mesh animation or with it.

i'm not sure if it will evolve anymore. maybe i can add animation blending, but undecided about it, as very few -if any- people will use it. maybe real life usage will dictate some additions/modifications.

as i said in above posts, my first attempt was to use/fix cyber's ogre3d loader but as jME has a stable loader it seemed easier and more natural to use it.

for exporting, Bones uses java serialization. it doesnt serialize whole objects but parts of it. you can look at the code, it's straightforward. a custom exporter is possible but IMHO there is no need for it. i would suggest collada or even better OgreMax exporter to export from 3ds max. then use the Bones scripts to convert to bones format..

r a f t

raft

an experimental facial animation demo:
http://www.youtube.com/watch?v=vemKY9kosvI

the model and animation is loaded via jME's OgreXML loader. in Ogre terminology, it's Pose animation. it's similar to jPCT's mesh animation but instead of vertex positions, vertex position offsets are stored in animation file. the good thing about this is, as offsets are used, multiple pose animations can be easily blended. it's also possible to blend pose and skeletal animations. it also requires less space as data is only stored for animated vertices.

however i'm not sure how to combine this with skeletal part of Bones. possibly many of classes will be renamed to provide some space for new ones and some restrictions will be relaxed.

these two parts will possibly use two different IVertexController's, so another question is how to make them cooperate in an easy to use manner such that one doesn't destroy other's work.

r a f t

.jayderyu

nice, I didn't imagine that Bone/skeletal animation could have facial animation. That's awesome. Great job to Raft who's doing the porting and the Ardor3d team.

raft

thanks ;D this time it's jME port indeed  ;)

raft

#19
i've uploaded the new release. quite a lot of changes this time:


  • Added support to load Ogre3D pose animations via jME's OgreXML loader.
  • Renamed many classes to provide some space for new animations.
  • Pose animations can be blended within each other and with a single skin animation.
  • Completely decoupled jME and Ardor3D importing code into new classes. This was necessary to run Bones on Android (Dalvik refuses to load classes if there are constructors/methods which has parameters of unknown classes).
  • Added support to scale/rotate objects/skeleton/animations at import time.
  • Exposed some constructors, methods and data structures to allow programatically created animated objects, skeletons and animations.
  • Added some more sample applications.

Sorry for breaking backward compatibility but as nobody is actively using Bones, this wont differ that much

A capture of animation blending demo

cheers ;D
r a f t

raft

new version:

  • Updated documentation.
  • Fixed a minor bug causing applying skeleton pose twice.
  • Added a sample Android application. (Downloaded seperately)

EgonOlsen

I can't help, but your test object reminds me of some part of the male body that has no bones at all... ;D

raft


raft

updated the Android sample to show/animate up to 8 ninjas. starting from second model fps seriously drops. below screenshot is taken from G1. 3 models @ 4fps.

i wonder how this will perform in nexus one. maybe dl.zerocool can try this too ;)



dl.zerocool

Hello there,

As always I'm proud to test your apps, and here are the results.

Without animation:



With animation:




Hope it will be helpful.

raft

thanks dl, they really help :D

12 fps with 3 models. with some bubbles and a simple gui this will drop to ~8-10 fps. so a very lite karga seems to be barely playable even on nexus one :-\

EgonOlsen

Maybe not when using Bones on Android,  but keyframe animations should run much faster. A simple md2 runs at around 25fps on my phone.

raft

how many polygons ?

skeletal animation occupies much less space and possibly loads faster. maybe creating mesh keyframes on the fly is the way to go..

EgonOlsen

I'm not sure about the polygon count...it's that snork md2 that i used for the first alpha of Robombs. It's a normal md2, i.e.,its polygon count should be similar to most other md2s.

Using a hybrid to generate keyframes from a skeletal animation sounds like a smart and scalable approach.

raft

possibly very low polygon, in 200-300 range or similar.. ninja is about 900 + 100 (body and sword are seperate models)

i've tried ninja demo with mesh keyframes. it does run faster as expected, something like %15-20 (hard to measure exactly) but definetely not a boost. skeletal animation does moderately heavy matrix calculations but seems as it's not the bottleneck. pumping mesh data to gpu is. %20 increase is definetely good but the memory cost is also high.

here is the apk if wanna see. you can switch to mesh/skin animation via menu
http://www.aptalkarga.com/bones/Bones-Android-Ninja2.apk

regarding discussion in android board, if we had a JIT this time, it will just allow skeletal animation performance approach to mesh animation. after that we would still be limited to java to native data passing barrier, rigth ? or am i missing something ?