General advice on model/skeleton structure for Bones

Started by neo187, September 17, 2011, 10:36:48 AM

Previous topic - Next topic

neo187

Hello there

Before I start skinning and rigging my model for this Android demo that I'm making with JPCT, I was wondering if there is any particular guidelines on how the model should be built.

Is there a rough number of polys that you guys would recommend for the average Android phone when using this engine? Is there any special instruction for the building of the skeleton? Number of bones, dependencies etc....

Thank you very much!

raft

Well, not really. It all depends on your application. Needless to say, low polys perform better, high polys looks better. Number of polygons also depends on how many of animated models you will use simultaneously. It also depends on background scene. A few hundreds polygons may be optimal, but again it depends on your application.

Number of bones in skeleton does not make much difference. It certainly increases memory usage and processing but not that much. No other requirements for bones in skeleton.

neo187

Thanks for your help on that, some formats like the .psk for Unreal requires very funny pre requisites like that all bones generate indirectly from the master bone and are somehow linked to it....

I was thinking of something of roughly the same level of detail as the Ninja model in the demo, am curious as to how many polys are there... There would only be one animated model and a fairly small scene with low poly models....

Also, are bounding boxes created automatically for animated groups or is there a function to call? For regular Object3D objects I understand that obj.build() would do that?

Thanks for your help!

raft

Don't know th exact number but Ninja has 781+61 vertices. (body + sword). so it has roughly ~300 polygons

For bounding box, as Animated3D extends Object3D, it has all the properties Object3D has including bounding box

neo187

Thanks for that! I am actually trying to move the Ninja around and test for collisions with another model but I get a NullPointReference if I call

directionVector = ninjas.get(0).getRoot().checkForCollisionEllipsoid(directionVector, ellipsoid, 1);

So basically I call the addNinja() method on startup which places the ninjas.get(0) ninja in the middle.  I added these line to the addNinja method to enable collision detection:


ninja.getRoot().setCollisionMode(Object3D.COLLISION_CHECK_SELF);


Right before the ninja.addToWorld method and then if a button is pressed I set apply the direction vector to it but with the checkForCollision call I only get a Null error....

Any idea why?

Thanks for your awesome help.


raft

root is a dummy empty object that is not itself added to world. all Animated3D's in a group is added to root as a child, this is for translating/rotating all objects together and easily. so you need to call collision methods not on root but on Animated3D's.

for example to check collision on first Animated3D:

ninja.get(0).setCollisionMode(Object3D.COLLISION_CHECK_SELF);
directionVector = ninja.get(0).checkForCollisionEllipsoid(directionVector, ellipsoid, 1);

neo187

Brilliant. That did it. Only that in the Ninja demo ninjas.get(0) returns an AnimatedGroup. For the Animated3D object I had to do:


ninjas.get(0).get(0).setCollisionMode(Object3D.COLLISION_CHECK_SELF);
directionVector = ninjas.get(0).get(0).checkForCollisionEllipsoid(directionVector, ellipsoid, 1);


Thanks for your prompt help!

neo187

#7
Hi Raft!

Back again... Wanted to ask your advice on the performance of my app so far... on my ZTE Racer (Android v2.1) I get about 20 fps with up to three animated ninjas on screen... With my own app I am stuck between 5 and 10 fps with only my model up. I used the Optimizer modifier in 3DS Max to get my mesh down to around 1100 polygons, so it's not much more than the Ninja....

I was wondering if there's anything else that can contribute to speed up to processing a bit, if it's in the number of bones in the skeleton or particular engine operations to try and cut down on....

Thank you for your support!

raft

1100 polygons is much more higher than 3 ninjas. if I remember correctly a ninja is ~300 vertices not polygons.

i have no specific advice.

your app will perform better on 2.2 and higher because of JIT