www.jpct.net

jPCT-AE - a 3d engine for Android => Support => Topic started by: rafaelsm on July 09, 2014, 04:55:38 PM

Title: Animation guidance
Post by: rafaelsm on July 09, 2014, 04:55:38 PM
Hello,

I'm using Blender for modeling and animations to develop a live wallpaper. Loading 3ds and texture with JPCT_AE works really well but I'm stuck at loading the animations.

I have the following questions:

1- Do I need to export the animation in a especific format (If yes, how can I do that from blender)?
2- How can I make the animation work with the 3ds file in JPCT_AE?

Please, help a noob  :)

thanks!


Title: Re: Animation guidance
Post by: EgonOlsen on July 09, 2014, 05:40:35 PM
Depends on what exactly you mean by animation. Animation like a walking human or animation like an object following some path?
Title: Re: Animation guidance
Post by: rafaelsm on July 09, 2014, 06:00:16 PM
Animation like walking, using armature to move the mesh.
Title: Re: Animation guidance
Post by: EgonOlsen on July 09, 2014, 11:15:58 PM
In that case, you have basically three options. First, you have to decide if you want to use keyframes or skeletal animations. The former is faster to process but uses more memory, the latter is the other way round. If you opt for keyframes, you can either use the md2 format (but i think exporting from Blender into md2 is kinda crappy if it's still available at all) or create single keyframes (http://www.jpct.net/wiki/index.php/Loading_3ds_Keyframes_from_Blender (http://www.jpct.net/wiki/index.php/Loading_3ds_Keyframes_from_Blender)). If you go for skeletal animations, you can use Bones: (http://www.jpct.net/forum2/index.php/board,10.0.html (http://www.jpct.net/forum2/index.php/board,10.0.html), http://www.jpct.net/wiki/index.php/Exporting_from_Blender_to_Bones (http://www.jpct.net/wiki/index.php/Exporting_from_Blender_to_Bones)).
Title: Re: Animation guidance
Post by: rafaelsm on July 10, 2014, 01:37:09 AM
I see, in that case I think I'll go for Bones, memory in android devices is a huge pain in the ass!

Thanks for the help!
Title: Re: Animation guidance
Post by: makvasic on October 15, 2014, 06:49:49 PM
Quote from: EgonOlsen on July 09, 2014, 05:40:35 PM
Depends on what exactly you mean by animation. Animation like a walking human or animation like an object following some path?

Hello,

Can you answer the other part of the question?
I'm having trouble translating object  to follow the curve path.
More precisely, I have curve object with moving texture and I need to put another object on top to move with the texture.
I tried with translation matrix but seems too complex, so I just want to know if is there any better way or solution for how it should be done?

Thanks in advance.
Title: Re: Animation guidance
Post by: EgonOlsen on October 15, 2014, 10:03:36 PM
Can you illustrate this somehow? Curve object, moving texture...i think i don't get it...
Title: Re: Animation guidance
Post by: makvasic on October 15, 2014, 11:15:40 PM
Well,

Try to imagine river that flows over the hill and leaf is in the water. Hill is object,
river is texture (which is not important I'm just changing UV coordinates with TextureMatrix to get moving effect)
and leaf is also an object.
So leaf follows flow of the river.
Of course you can assume that Camera is fixed.
I'm sending you embarrassing picture to get the idea, and hope it's enough.

Thank you kindly for what you have done and still doing.
Title: Re: Animation guidance
Post by: EgonOlsen on October 16, 2014, 08:23:24 PM
I assume that the change in the texture's matrix is linear. So you could move the leaf linear with the same "speed" in the xz-plane. Then you can move the leaf up, so that it's on top of the plane, use http://www.jpct.net/jpct-ae/doc/com/threed/jpct/Object3D.html#calcMinDistance(com.threed.jpct.SimpleVector, com.threed.jpct.SimpleVector) (http://www.jpct.net/jpct-ae/doc/com/threed/jpct/Object3D.html#calcMinDistance(com.threed.jpct.SimpleVector,%20com.threed.jpct.SimpleVector)) to calculate the distance from the leaf's position to the (curved) plane and translate it down by that amount. Remember to make the plane a collider (http://www.jpct.net/jpct-ae/doc/com/threed/jpct/Object3D.html#setCollisionMode(int) (http://www.jpct.net/jpct-ae/doc/com/threed/jpct/Object3D.html#setCollisionMode(int))) for this to work.