Animate an avatar with jpct for Android

Started by Noxys3, June 07, 2017, 11:44:11 AM

Previous topic - Next topic

Noxys3

Hello,
I am working on an Android project that looks like pokemonGo. I have an avatar that I made with Blender and MakeHuman. I use the "MakeWalk" function to animate it in Blender and now I want to display this animation in my application.
I already use JPCT_AE to display my avatar on a map but I used .OBJ format and so can't animate it. I looked for solutions on the forum and website and I found three main solutions : MD2 model, Ogre Mesh format (and Bones API) and keyframe animation as it is explained here : http://www.jpct.net/wiki/index.php/Loading_3ds_Keyframes_from_Blender.

My point is : what is the best solution for my project? I want to have a 3D avatar that can be personalized by the user by changing his textures and also animate it on the map when the user is walking.
I have memory constraints so I can't use many obj files for each pose.

I need expert's advice  :P

Thanks a lot!

Nox

AGP

Skeletal animations' main advantage is animation blending. With them, a character can, for instance, walk and talk at the same time. Much more importantly, you can transition between, say, a walk and a run seamlessly. So if you have an Ogre exporter that works for you, go for it.

EgonOlsen

However, for a simple walking animation, keyframes might be sufficient as well. I guess it depends on your needs and your tools/models.

Noxys3

Thank you for you replies.
Indeed I don't need high accuracy. I have 220 keyframes created by makewalk yet but I can keep only 8 to get a good movement.
So if I understood, I need to use 3ds format to animate my object? Could I still change my object's textures with this format?
regards,
Nox

Locust

I basically did what you want. I did my model in MakeHuman exported it to Blender and animated it there.

Export your model from blender to the Ogre XML mesh format. Bones has some scripts appended which lets you transform these into native bones format, which can be easily loaded by the engine.
How-to: http://www.jpct.net/wiki/index.php?title=Exporting_from_Blender_to_Bones
Quote from: Noxys3 on June 08, 2017, 09:13:11 AM
I have 220 keyframes created by makewalk yet but I can keep only 8 to get a good movement.
I don't really get whats the point here.
Quote from: Noxys3 on June 08, 2017, 09:13:11 AM
Could I still change my object's textures with this format?
I guess, but I havent tried changing textures at runtime yet.

AGP

If you're going with vertex animations, your best bet is MD2. You could export all the keyframes in OBJ or 3DS, but then you'd have to manually add them to your animation in jpct. MD2 will export the whole thing in a single file.

Noxys3

Hi,
Thank you for your answers!

Thanks Locust for your link, i have already found it but I wanted to be sure it could help me and be the best way to do what I want to.
I said in my previous post that, at the moment, I'm doing my walking movement with a lot of frames, and I wondered if it could be a problem when exporting to Ogre XML format.

Quote from: AGP on June 08, 2017, 09:14:15 PM
If you're going with vertex animations, your best bet is MD2. You could export all the keyframes in OBJ or 3DS, but then you'd have to manually add them to your animation in jpct. MD2 will export the whole thing in a single file.
Ok it seems to be usefull! But does MD2 only contain animation or does it also contain 3D object (like .obj and mtl)? Can I create my object3D only with MD2 or should I use .obj file and then use MD2 to animate it?

AGP

It's a format like any other. Loader.loadMD2 will give you an Object3D with its Animation instance filled.