Author Topic: Bones - Skeletal and Pose animations for jPCT  (Read 239891 times)

Offline raft

  • Moderator
  • quad
  • *****
  • Posts: 1993
    • View Profile
    • http://www.aptalkarga.com
Re: Bones - Skeletal animation for jPCT
« Reply #15 on: February 19, 2010, 05:39:17 pm »
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

Offline raft

  • Moderator
  • quad
  • *****
  • Posts: 1993
    • View Profile
    • http://www.aptalkarga.com
Re: Bones - Skeletal animation for jPCT
« Reply #16 on: February 25, 2010, 05:07:36 pm »
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

Offline .jayderyu

  • long
  • ***
  • Posts: 116
    • View Profile
Re: Bones - Skeletal animation for jPCT
« Reply #17 on: February 25, 2010, 06:38:18 pm »
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.

Offline raft

  • Moderator
  • quad
  • *****
  • Posts: 1993
    • View Profile
    • http://www.aptalkarga.com
Re: Bones - Skeletal animation for jPCT
« Reply #18 on: February 25, 2010, 10:00:08 pm »
thanks ;D this time it's jME port indeed  ;)

Offline raft

  • Moderator
  • quad
  • *****
  • Posts: 1993
    • View Profile
    • http://www.aptalkarga.com
Re: Bones - Skeletal and Pose animations for jPCT
« Reply #19 on: March 29, 2010, 08:53:24 pm »
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
« Last Edit: March 29, 2010, 09:12:12 pm by raft »

Offline raft

  • Moderator
  • quad
  • *****
  • Posts: 1993
    • View Profile
    • http://www.aptalkarga.com
Re: Bones - Skeletal and Pose animations for jPCT
« Reply #20 on: March 30, 2010, 03:49:35 pm »
new version:
  • Updated documentation.
  • Fixed a minor bug causing applying skeleton pose twice.
  • Added a sample Android application. (Downloaded seperately)

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Bones - Skeletal and Pose animations for jPCT
« Reply #21 on: March 30, 2010, 08:17:39 pm »
I can't help, but your test object reminds me of some part of the male body that has no bones at all... ;D

Offline raft

  • Moderator
  • quad
  • *****
  • Posts: 1993
    • View Profile
    • http://www.aptalkarga.com
Re: Bones - Skeletal and Pose animations for jPCT
« Reply #22 on: March 30, 2010, 08:30:33 pm »
ehm ::) i agree but it's not intentional ;D

Offline raft

  • Moderator
  • quad
  • *****
  • Posts: 1993
    • View Profile
    • http://www.aptalkarga.com
Re: Bones - Skeletal and Pose animations for jPCT
« Reply #23 on: April 01, 2010, 03:08:51 pm »
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 ;)


 

Offline dl.zerocool

  • long
  • ***
  • Posts: 104
    • View Profile
Re: Bones - Skeletal and Pose animations for jPCT
« Reply #24 on: April 01, 2010, 04:36:42 pm »
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.

Offline raft

  • Moderator
  • quad
  • *****
  • Posts: 1993
    • View Profile
    • http://www.aptalkarga.com
Re: Bones - Skeletal and Pose animations for jPCT
« Reply #25 on: April 01, 2010, 05:10:28 pm »
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 :-\

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Bones - Skeletal and Pose animations for jPCT
« Reply #26 on: April 02, 2010, 10:59:25 am »
Maybe not when using Bones on Android,  but keyframe animations should run much faster. A simple md2 runs at around 25fps on my phone.

Offline raft

  • Moderator
  • quad
  • *****
  • Posts: 1993
    • View Profile
    • http://www.aptalkarga.com
Re: Bones - Skeletal and Pose animations for jPCT
« Reply #27 on: April 02, 2010, 01:56:12 pm »
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..

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Bones - Skeletal and Pose animations for jPCT
« Reply #28 on: April 02, 2010, 03:49:50 pm »
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.

Offline raft

  • Moderator
  • quad
  • *****
  • Posts: 1993
    • View Profile
    • http://www.aptalkarga.com
Re: Bones - Skeletal and Pose animations for jPCT
« Reply #29 on: April 02, 2010, 04:17:17 pm »
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 ?