Author Topic: Animate rigged model according to given commands  (Read 67603 times)

Offline aeroxr1

  • int
  • **
  • Posts: 82
    • View Profile
Animate rigged model according to given commands
« on: June 05, 2014, 10:14:22 pm »
Hello to everyone :)
I'm trying to animate a human's rigged model for an Android Application ( Real-time Motion Capture ).
Is possible to do this using jPCT-AE and Bones ?
Something like this https://www.youtube.com/watch?v=NYT-nx533nM

I have the library that gives me the position of the sensor in a quaternion.
I thought to set the quaternion on the relative bones.
But I don't know which function I have to use to identify bones and joints of my rigged model and which function I have to use to set its position in quaternion format.

Have you any suggestion for me ? 

Thanks all :)

Offline raft

  • Moderator
  • quad
  • *****
  • Posts: 1993
    • View Profile
    • http://www.aptalkarga.com
Re: Animate rigged model according to given commands
« Reply #1 on: June 06, 2014, 10:02:37 am »
yes, sure it's possible. you have to set position/rotation of joints of skeleton. that is done via SkeletonPose. as its name suggests it's a pose of Skeleton. later that pose is applied to target object's mesh via Animated3D.applySkeletonPose().

have a look at ProceduralAnimationSample which programatically changes SkeletonPose and applies it.

however, calculating poses based on some input is not trivial and to tell the truth i'm not fluent with writing equations for it.

Offline aeroxr1

  • int
  • **
  • Posts: 82
    • View Profile
Re: Animate rigged model according to given commands
« Reply #2 on: June 06, 2014, 11:15:38 am »
Thank you so much :)

I'll download jpct-ae and bones and I'll look the proceduralanimationsample :)

Offline aeroxr1

  • int
  • **
  • Posts: 82
    • View Profile
Re: Animate rigged model according to given commands
« Reply #3 on: June 12, 2014, 09:36:00 pm »
Sorry,
I downloaded bones-android-ninja, I imported it in eclipse , but
5 errors appeared :

Code: [Select]
import raft.jpct.bones.Animated3D;
import raft.jpct.bones.AnimatedGroup;
import raft.jpct.bones.BonesIO;
import raft.jpct.bones.SkeletonPose;
import raft.jpct.bones.SkinClip;

(import raft cannot be resolved)

And I have another question :

bones is included in jpct-ae ?
or I have to import some library ? I ask that because I'm downloaded jpct and bone , but I don't find bones's libs :/

Offline raft

  • Moderator
  • quad
  • *****
  • Posts: 1993
    • View Profile
    • http://www.aptalkarga.com
Re: Animate rigged model according to given commands
« Reply #4 on: June 13, 2014, 08:43:35 am »
Bones is not included in ninja demo app. you should download it separately and import to Eclipse. by default, Ninja demo app looks for Bones project in its classpath.

for your own projects, either add Bones the same way to your classpath or add its jar, which is in Bones/build directory.


Offline aeroxr1

  • int
  • **
  • Posts: 82
    • View Profile
Re: Animate rigged model according to given commands
« Reply #5 on: June 13, 2014, 09:11:48 pm »
I don't find its jar :/

Offline raft

  • Moderator
  • quad
  • *****
  • Posts: 1993
    • View Profile
    • http://www.aptalkarga.com
Re: Animate rigged model according to given commands
« Reply #6 on: June 13, 2014, 09:33:59 pm »
it is in Bones.zip/build directory

Offline aeroxr1

  • int
  • **
  • Posts: 82
    • View Profile
Re: Animate rigged model according to given commands
« Reply #7 on: June 13, 2014, 09:43:31 pm »
sorry i'm burned out  :'(

(tired and stupid -.-")

Before to read your post I compiled and built all files included in Bone.zip ahahah
« Last Edit: June 13, 2014, 09:47:31 pm by aeroxr1 »

Offline raft

  • Moderator
  • quad
  • *****
  • Posts: 1993
    • View Profile
    • http://www.aptalkarga.com
Re: Animate rigged model according to given commands
« Reply #8 on: June 13, 2014, 09:44:49 pm »
np ;)

Offline aeroxr1

  • int
  • **
  • Posts: 82
    • View Profile
Re: Animate rigged model according to given commands
« Reply #9 on: August 19, 2014, 02:47:11 pm »
can you suggest me a rigged model that is easy to export to bones ?
I downloaded this model http://www.blendswap.com/blends/view/21948 and I'm trying to follow this tutorial http://www.jpct.net/wiki/index.php/Exporting_from_Blender_to_Bones to export in bones format, but for now I'm failing  :'(

Offline raft

  • Moderator
  • quad
  • *****
  • Posts: 1993
    • View Profile
    • http://www.aptalkarga.com
Re: Animate rigged model according to given commands
« Reply #10 on: August 19, 2014, 03:06:01 pm »
not really, sorry :/ i've never exported from Blender myself. maybe contacting a Blender user may help?

Offline aeroxr1

  • int
  • **
  • Posts: 82
    • View Profile
Re: Animate rigged model according to given commands
« Reply #11 on: August 19, 2014, 03:34:35 pm »
Which extension of model do you usually use ?

Offline raft

  • Moderator
  • quad
  • *****
  • Posts: 1993
    • View Profile
    • http://www.aptalkarga.com
Re: Animate rigged model according to given commands
« Reply #12 on: August 19, 2014, 03:49:31 pm »
in the past i've used 3dsMax + OgreMax exporter to export to Ogre3D format. it was quite stable and usable. AFAIK there is an OgreMax for Maya too.

Offline aeroxr1

  • int
  • **
  • Posts: 82
    • View Profile
Re: Animate rigged model according to given commands
« Reply #13 on: August 19, 2014, 08:01:26 pm »
I want to develop Android app but if I want to see if the conversion is done well can I import bones project in eclipse and use LoadBonesFormatSample ?

I did :
1- exported from blender to collada
2- used collada script exporter (in rotation what I have to put ? O.o )
3- I changed the LoadBonesFormatSample's code line from
Code: [Select]
FileInputStream fis = new FileInputStream("./samples/data/ninja/ninja.group.bones");to
Code: [Select]
FileInputStream fis = new FileInputStream("./samples/data/ninja/scheletro.group.bones");4- imported all the folder in eclipse and run LoadBonesFormatSample

But sadly It doesn't work, I see only one ninja's leg -.-" During the conversion the warning say me "WARNING : max of 4 joints .."

last question : when I export in ogree different files are being created , but how I have to use jmeOgre2Bones ?

For example in the last conversion I had this file :
- Sphere.000.mesh
- Sphere.000.mesh.xml
-Sphere.004.mesh
-Sphere.004.mesh.xml
-Sphere.004.skeleton
-Sphere.004.skeleton.xml

p.s : now I'm downloading 3dmax student version .. I have to find the way to import a rigged model in bones :(
« Last Edit: August 19, 2014, 09:20:53 pm by aeroxr1 »

Offline raft

  • Moderator
  • quad
  • *****
  • Posts: 1993
    • View Profile
    • http://www.aptalkarga.com
Re: Animate rigged model according to given commands
« Reply #14 on: August 20, 2014, 09:41:08 am »
1- exported from blender to collada
why not export to Ogre format as mentioned in wiki page? i found Ogre a much usable format
2- used collada script exporter (in rotation what I have to put ? O.o )
Code: [Select]
-rotation x180

last question : when I export in ogree different files are being created , but how I have to use jmeOgre2Bones ?
Code: [Select]
jmeOgre2Bones -rotation x180 -out sphere.group.bones -in Sphere.000.mesh.xml