Before committing to this engine I needed to verify that it could handle 22 uniquely animated meshes (same base model) concurrently. Here's the setup code:
models = new Object3D[22];
for(int i = 0; i < 22; i++)
{
models[i] = new Object3D(model, false);
//spread them out in a line for viewing them all at once
models[i].translate(i*30, 0 0);
models[i].build();
world.addObject(models[i]);
}
I also have the app setup with a Primitive Plane representing the ground:
Object3D ground = Primitives.getPlane(10, 200);
ground.build();
ground.setTexture("grass");
ground.calcTextureWrap();
//function from http://www.jpct.net/wiki/index.php/Advanced_example
tileTexture(ground, .5f);
//rotate by 90 degrees to put it on the x-z plane
ground.rotateX(0.0174532925f * 90f);
world.addObject(ground);
as well as the exact skydome model and code from
http://www.jpct.net/wiki/index.php/Advanced_exampleand then later in the render function:
//repeat the animation every 5 seconds
float anim = (float)(System.currentTimeMillis() % 5000)/5000;
for(int i = 0; i < 22; i++)
{
//set them all to a slightly different key frame
float index = anim + (float)(i*5)/1000;
if(index > 1f)
index -= 1f;
models[i].animate(index);
models[i].build();
}
The compiled app comes out at 488kb.
When all the animations are visible I am getting ~6-10 fps. With only 1 animation running, it runs at 58-60 fps. My phone is
http://www.htc.com/us/support/aria-att/tech-specs/.
Is this low fps what you would expect, or might I have some other problem going on?
The animation I am using is attached (i got it from
http://jpct.de/download/mesh/quake2_models.7z)
[attachment deleted by admin]