Main Menu
Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Topics - kiffa

#61
Support / How does the Virtualizer work?
September 04, 2012, 07:16:06 AM
I want to use the Virtualizer class of jPCT-AE to resolve OOM, and i have read the doc, but i want to know a little more, thanks.

The process of my app is like this:

Load all models(.ser and .bones) ->
entry Scene1 -> Load all textures which are used in scene1 only -> some logic\event\draw ->
switch to Scene2 -> removeAndUnload all textures(Config.unloadImmediately = true) ->
entry Scene2 -> Load all textures which are used in scene2 only -> repeat like scene1 ... ...
-> switch to SceneN ... ...

And the OOM usually happened in the stage of "entry new scene -> load textures", my question:

1, Does the process of loading texture need more memory(peak) than the texture itself? For example:  new Texture("1024X1024.jpg"), the texture will consume 1024x1024x4 bytes of memory finally, but does the process of "new Texture(like io、decode-jpg and so on)" need more memory than 4MB?     

2, Does TextureManager.removeAndUnload () guarantee freeing memory immediately ?

3, Does the follow memory-route right?

new Texture(1024X1024) -> 4MB

set Virtualizer -> set context -> virtualize the texture -> swap the texture from vm to disk(flash) -> 0MB

Frambuffer.draw() -> upload the texture to GPU -> I don't know what happen with the virtualized-texture in this stage, help please.

removeAndUnload the virtualized-texture -> what happened?

Does the virtualized-texture need be swapped back(from disk to vm) in any situation? When? Does the process of virtualizing need more memory(peak) than the texture itself? How much time does the process of virtualizing consume typically?

4, Seems there are enough memory in every scene of my app(all of them can run fine alone),  but OOM happened in the scene switching, any suggestions? Many thanks! I have reduced my texture to two jpg(512X512) per scene, and it's hard to reduce more. And i also enabled Texture.4bpp, disabled Texture.Mipmapping.
#62
My codes:

   
    Object3D mDog = xxxxxx; //Loader init
    Object3D obj =  Object3D.createDummyObj();
    obj.addChild(mDog);
    obj.addChild(otherObjs);
    obj.rotateY(1);

   if(mDog.getRotationMatrix().isIdentity()){
      log.d("xx", "true");
  };

   if(mDog.getTranslationMatrix().isIdentity()){
      log.d("xx", "true2");
  };



The result is "true"、"true2".

I want to reset "mDog" to its original position after "obj.rotateY(1)",  and the code "mDog.clearRotation()" is useless. Doesn't the rotation of the parent-Object3D affect the RotationMatrix of children-Object3D?
#63
Support / How to set the transparency of texture?
August 27, 2012, 09:35:16 AM
I used a PNG file with alpha channel as the texture of an Objcet3D, and some fragment of the Object3D were mapped to full-transparency pixel of the texture.

But when i run the app, the fragment which should be full-transparency were filled with black color.

How do i set the transparency of texture? My codes:

      in = res.openRawResource(R.raw.tex_world_trees);
      Texture t = new Texture(in, true);  // with alpha
      tm.addTexture("world_trees", t);
      in.close();
     
     obj.setTexture("world_trees");

    world.addObject(obj);
    //render、draw、display...

   
#64
Bones / Could i load the skin-animations separately?
August 10, 2012, 08:38:59 AM
I have an animated-dog, it has many skin-animation-frames(about 2000+, sampled by 24frame/s).

If i load all of them in one time, the left memory will be not enough. So, i want to load 1 - 1000 frames in scene1, and when the world switch to scene2, i will release 1-1000 frames, and load 1000-2000 frames.

How could i do this?
#65
I have the models of a dog and an island, and the dog is animated, the island is not.

I combined the island to the dog in maya, so the island will be the sub-meshes of the dog.  And i exported the combined model into only one .mesh.xml, then converted to .bones which named dog.bones(included the dog and the island in fact).

Then, i use BonesIO.loadGroup to load  the dog.bones, and there will create some Animated3D objects, one(the dog) have animation-data, the others have not.

My question is: With the same model, does the Animated3D obj retain more memory than the Object3D?

For examble, with the same island model:
A: The island model(.bones) is loaded into an Animated3D object as a sub-mesh of the animated-dog-model.
B: The island model(.obj or .ser)  is loaded into an Object3D object.
Will "A" retain more memory than "B"?  And if so, about how many than?
#66
Support / Memory leak when i tried to switch views.
August 06, 2012, 05:19:26 AM
My app has 2 views, the one is SurfaceView, the other is GLSurfaceView. I need switch between them frequently, so i want to just load the models once and keep them in the memory in order to speed up the switching process.

The process:
entry SurfaceView -> switch to GLSurfaceView -> load models -> init world and others -> render and display world -> switch to SurfaceView -> switch to GLSurfaceView -> just use pre-loading models without reloading -> init world and others -> render and display world -> .....

But there seems a memory-leak in my test-app, my codes(some pseudo code):

//onSurfaceCreated

if(modelsPreloded)
  use preloadedModels and textures;
else
  loadModels() and initTextures();

initWorldAndOthers();
addAllModelsToWorld();
buildAllObjctes();

// onSurfaceChanged
  mFrameBuffer = new FrameBuffer(width, height);

// onDrawFrame
animate();
mWorld.renderScene(mFrameBuffer);
mWorld.draw(mFrameBuffer);
mFrameBuffer.display();

// onTouchEvent
if(touch down)
  mActivity.setContentView(new MyGLSurfaceView(mActivity));


With per touching down, the memory usage will increase about 500K. But what i expect is that there should be non memory usage increasing when switching from an old GLSurfaceView to the new one.

And if i change code to de-active "mWorld.renderScene(mFrameBuffer)" and "mWorld.draw(mFrameBuffer)", there will no memory usage increase when i touch down:

// onDrawFrame
animate();
//mWorld.renderScene(mFrameBuffer);
//mWorld.draw(mFrameBuffer);
mFrameBuffer.display();


Should i do some clear work before switching views? I tried mFrameBuffer.freeMemory() and mFrameBuffer.dispose(), seems useless.
#67
First i have a animated-obj(.bones) with 1566 frames(24frames/s) animations, with this obj, my code ran fine. And the heap-free-mem was about 11M which was reported by DDMS.

And then i added some more animations to this obj(1566 -> 1755),  with this one, OutOfMemoryError happened.

I don't think  1755 - 1566 = 189 frames-bones-animation will eat 11M of memory.

When i run my app, the heap changed like this:
  first, there was about 3 - 4 M free memory  ---- maybe loading obj...
  then,  the free memory suddenly jumped to 11M.
  then,  OutOfMemoryError happened:

05-13 20:08:31.500: E/AndroidRuntime(4704): java.lang.OutOfMemoryError
05-13 20:08:31.500: E/AndroidRuntime(4704):    at org.apache.harmony.luni.platform.OSMemory.malloc(Native Method)
05-13 20:08:31.500: E/AndroidRuntime(4704):    at org.apache.harmony.luni.platform.PlatformAddressFactory.alloc(PlatformAddressFactory.java:129)
05-13 20:08:31.500: E/AndroidRuntime(4704):    at java.nio.DirectByteBuffer.<init>(DirectByteBuffer.java:65)
05-13 20:08:31.500: E/AndroidRuntime(4704):    at java.nio.ReadWriteDirectByteBuffer.<init>(ReadWriteDirectByteBuffer.java:48)
05-13 20:08:31.500: E/AndroidRuntime(4704):    at java.nio.BufferFactory.newDirectByteBuffer(BufferFactory.java:93)
05-13 20:08:31.500: E/AndroidRuntime(4704):    at java.nio.ByteBuffer.allocateDirect(ByteBuffer.java:65)
05-13 20:08:31.500: E/AndroidRuntime(4704):    at com.threed.jpct.GLRenderer.convertTexture(GLRenderer.java:800)
05-13 20:08:31.500: E/AndroidRuntime(4704):    at com.threed.jpct.GLRenderer.setTextures(GLRenderer.java:2270)
05-13 20:08:31.500: E/AndroidRuntime(4704):    at com.threed.jpct.GLRenderer.drawVertexArray(GLRenderer.java:2195)
05-13 20:08:31.500: E/AndroidRuntime(4704):    at com.threed.jpct.World.draw(World.java:1307)
05-13 20:08:31.500: E/AndroidRuntime(4704):    at com.threed.jpct.World.draw(World.java:1074)
05-13 20:08:31.500: E/AndroidRuntime(4704):    at com.zwenyu.scene.Main3DScene.renderWorld(Main3DScene.java:76)
05-13 20:08:31.500: E/AndroidRuntime(4704):    at com.zwenyu.scene.SceneBegin.onDrawFrame(SceneBegin.java:120)
05-13 20:08:31.500: E/AndroidRuntime(4704):    at com.zwenyu.view.Main3DSurfaceView$MyRenderer.onDrawFrame(Main3DSurfaceView.java:376)
05-13 20:08:31.500: E/AndroidRuntime(4704):    at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1363)
05-13 20:08:31.500: E/AndroidRuntime(4704):    at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1118)



#68
Support / How to estimate the memory-usage in jPCT-AE?
August 02, 2012, 06:20:15 AM
I have read this: http://www.jpct.net/wiki/index.php/Reducing_memory_usage

But i want to know more. Thanks!

How to estimate the memory-usage of an Object3D obj with some known attributes(such as  triangles、vertexs and so on )? For examble: How many memories will the jPCT-AE allocate when loading a 6000-triangles model? And what's the situation when invoke methods of this Object3D obj?

How to estimate  the memory-usage of a texture? Is that right: 
 
  1,   By default,  a 256*256 texture will need 256*256*4 bytes memory when "new texture(...)".
  2.a,  If enable "defaultToKeepPixels", there will need another 256*256*4 bytes when "World.draw(...)"(if enable4bpp then will be 256*256*2 bytes).
  2.b,  If disable "defaultToKeepPixels", there will need no extra memory when uploaded to gpu.

  How to estimate the memory-usage of both keyframe-animation and bones-animation?

  What's the situation when i use FrameBuffer.blit(...)?
#69
Support / Does jPCT-AE support shadow?
August 01, 2012, 08:36:40 AM
There is a ShadowHelper  class in jPCT but not in jPCT-AE.

I want to use shadow in my world with jPCT-AE, is there any simple way to do this?

Thanks!
#70
Bones / How to set material for objects in .bones?
July 31, 2012, 10:58:18 AM
OgreMax exported the .material.xml,  but how to use it?

Is .bones including the material info?
#71
Support / ERROR: before: glError 1285
July 30, 2012, 03:07:55 PM

Everything was ok when  my code like this:

Texture dogTexture = new Texture(mResources.openRawResource(R.raw.dog));  //the same texture-res
      Texture worldTexture = new Texture(mResources.openRawResource(R.raw.dog));    //the same texture-res
      Texture skyTexture = new Texture(mResources.openRawResource(R.raw.dog));       //the same texture-res

      TextureManager.getInstance().addTexture("dog", dogTexture);
      TextureManager.getInstance().addTexture("sky", dogTexture);
      TextureManager.getInstance().addTexture("world", worldTexture);



But crashed when i changed the codes to:

Texture dogTexture = new Texture(mResources.openRawResource(R.raw.dog));
      Texture worldTexture = new Texture(mResources.openRawResource(R.raw.dog));
      Texture skyTexture = new Texture(mResources.openRawResource(R.raw.dog));

      TextureManager.getInstance().addTexture("dog", dogTexture);
      TextureManager.getInstance().addTexture("sky", skyTexture);       //modified here
      TextureManager.getInstance().addTexture("world", worldTexture);



res/raw/dog is a 512*512 jpg. Crash info:

07-30 20:18:08.656: E/AndroidRuntime(10787): FATAL EXCEPTION: GLThread 10
07-30 20:18:08.656: E/AndroidRuntime(10787): java.lang.RuntimeException: [ 1343650688631 ] - ERROR: before: glError 1285
07-30 20:18:08.656: E/AndroidRuntime(10787):    at com.threed.jpct.Logger.log(Logger.java:189)
07-30 20:18:08.656: E/AndroidRuntime(10787):    at com.threed.jpct.GL20.checkError(GL20.java:142)
07-30 20:18:08.656: E/AndroidRuntime(10787):    at com.threed.jpct.GL20.glGenBuffers(GL20.java:1312)
07-30 20:18:08.656: E/AndroidRuntime(10787):    at com.threed.jpct.CompiledInstance.compileToVBO(CompiledInstance.java:1291)
07-30 20:18:08.656: E/AndroidRuntime(10787):    at com.threed.jpct.CompiledInstance.render(CompiledInstance.java:529)
07-30 20:18:08.656: E/AndroidRuntime(10787):    at com.threed.jpct.GLRenderer.drawVertexArray(GLRenderer.java:2211)
07-30 20:18:08.656: E/AndroidRuntime(10787):    at com.threed.jpct.World.draw(World.java:1307)
07-30 20:18:08.656: E/AndroidRuntime(10787):    at com.threed.jpct.World.draw(World.java:1074)
07-30 20:18:08.656: E/AndroidRuntime(10787):    at net.wenyu.Main3DSurfaceView$MyRenderer.renderWorld(Main3DSurfaceView.java:245)
07-30 20:18:08.656: E/AndroidRuntime(10787):    at net.wenyu.Main3DSurfaceView$MyRenderer.onDrawFrame(Main3DSurfaceView.java:145)
07-30 20:18:08.656: E/AndroidRuntime(10787):    at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1363)
07-30 20:18:08.656: E/AndroidRuntime(10787):    at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1118)
#72
My dog has 10364 triangles.

On my phone, the static-dog-fps is about 60, that's not bad, but when played the skin-animation, the fps dropped to only 6 fps, it seemed to be rather slow.

I have refered to jpct-ae-wiki-"Performance tips for Android", but seemed to be little help with my situation.

So, are there any advices to improve the performance of animation without reducing the faces of dog-model?

I am a beginner of 3D-graphics, so i want to know why an animating-object is much slower than the static one? What's the hotspot? And how to resolve it? I have tried to do the profiling with android-ADT,  and seemed like that the applySkeletonPose() cost the most cpu-time. I don't know if the bones-animation used the gpu(or other graphic-hardware) power, and how to profile this.  And how the hardware of a phone affect the performance, which is the most important factor: cpu、ram、gpu or others?

Thanks!

And my code is rather simple:
    Load an .bones animated-object, set AmbientLight, then play skin-animation.

There is almost little difference of the performance  between opengles-1.X and opengles-2.0 with my simple project.
#73
Bones / Animation seems strange
July 27, 2012, 07:02:48 AM
Maya2012 + OgreMax

First i made an dog-animation "run without position-moving"(which means the dog just run in situ). The animation played fine on my phone.

Then i changed the animation to "run with position-moving"(which means the dog run here and there). The .mesh and .skeleton runs fine in OgreMax-WinViewer. But when i played it on my phone(with .bones), something seemed to be strange:
 
  The dog's body moved, but the tail didn't move with the body. The tail seemed to stretched from origin position to where the dog's body moved to.

I tried jme3 with the same .mesh.xml and .skeleton.xml , evething was ok.

Shall i send the xml-file to you?

I will try .xml instead of .bones.
#74
My scene:
1, Objcets: a rock + a dog
2, Animations: rock-skin + dog-skin + dog-pose

I want to play all animations at the same time, my codes:


           //AnimatedGroup group
            group.animatePose(index, mAnimationIndex);             //dog-pose
            group.animateSkin(index, mAnimationIndex);              //dog-skin
            group.animateSkin(index, mAnimationIndex + 1);        //rock-skin
            group.applyAnimation();


When it run, just play rock-skin and dog-skin, dog-pose didn't be played. But if i changed my code like this(change order):


   group.animateSkin(index, mAnimationIndex);          //dog-skin
            group.animatePose(index, mAnimationIndex);         //dong-pose
            group.animateSkin(index, mAnimationIndex + 1);    //rock-skin
            group.applyAnimation();


Rock-skin 、dog-skin、dog-pose are all played.


And if:

     group.animateSkin(index, mAnimationIndex);          //dog-skin
            group.animateSkin(index, mAnimationIndex + 1);       //rock-skin
            group.animatePose(index, mAnimationIndex);           //dog-pose
            group.applyAnimation();


Dog-pose was played, and rock-skin seems to be played too, but rock-skin was rather different from what seen in maya.

Any advices?

#75
OgreMax + Maya2012

I want to merge all objects in one mesh.xml, OgreMax-doc say :
  Export the scene as a mesh file - When selecting the .mesh extension during an export all meshes in the scene will be merged into a single mesh centered around the world origin.

But when i converted the mesh.xml to .bones, error happened:

  Warning: Invalid triangle mode specified, assuming indexed triangles

  // many same waring...

Exception in thread "main" java.lang.NullPointerException
        at com.jmex.model.ogrexml.anim.OgreMesh.saveCurrentToBindPose(OgreMesh.
ava:174)
        at com.jmex.model.ogrexml.anim.MeshAnimationController.<init>(MeshAnima
ionController.java:124)
        at com.jmex.model.ogrexml.OgreLoader.loadMesh(OgreLoader.java:752)
        at com.jmex.model.ogrexml.OgreLoader.loadModel(OgreLoader.java:241)
        at com.jmex.model.ogrexml.OgreLoader.loadModel(OgreLoader.java:193)
        at raft.jpct.bones.util.JMEOgreImporter.loadGroup(JMEOgreImporter.java:
10)
        at raft.jpct.bones.util.JMEOgreImporter.loadGroup(JMEOgreImporter.java:
8)
        at raft.jpct.bones.util.JMEOgreImporter.run(JMEOgreImporter.java:69)
        at raft.jpct.bones.util.JMEOgreImporter.main(JMEOgreImporter.java:170)
#76
I made an animation of a dog. When playing the animation, the dog's head will move up and down.

Everything seems ok in maya. The dog has two ears, when his head move up, both of his ears should move up too, but on my phone, one of his ear moves up, the other seems like moving down......

maya2012 + OgreMax.

I have checked the .skeleton.xml, but i don't know if they are correct. Here are the track info:

left ear(correct-moving ear):

<track bone="joint34">
                    <keyframes>
                        <keyframe time="0">
                            <translate x="0" y="0" z="0" />
                            <rotate angle="0">
                                <axis x="1" y="0" z="0" />
                            </rotate>
                        </keyframe>
                        <keyframe time="0.239583">
                            <translate x="0" y="1.7112" z="-6.31536" />
                            <rotate angle="0.602536">
                                <axis x="1.37439e-008" y="0.982929" z="-0.183988" />
                            </rotate>
                        </keyframe>
                        <keyframe time="0.479167">
                            <translate x="0" y="0.0458412" z="-11.6619" />
                            <rotate angle="1.10437">
                                <axis x="-1.12722e-008" y="0.93108" z="-0.364815" />
                            </rotate>
                        </keyframe>
                        <keyframe time="0.71875">
                            <translate x="0" y="1.7174" z="-5.50479" />
                            <rotate angle="0.529574">
                                <axis x="9.25609e-009" y="0.987027" z="-0.160556" />
                            </rotate>
                        </keyframe>
                        <keyframe time="0.958333">
                            <translate x="0" y="0" z="0" />
                            <rotate angle="0">
                                <axis x="1" y="0" z="0" />
                            </rotate>
                        </keyframe>
                    </keyframes>
                </track>


right ear(wrong-moving ear):

     <track bone="joint38">
                    <keyframes>
                        <keyframe time="0">
                            <translate x="0" y="0" z="0" />
                            <rotate angle="0">
                                <axis x="1" y="0" z="0" />
                            </rotate>
                        </keyframe>
                        <keyframe time="0.239583">
                            <translate x="0" y="1.7112" z="-6.31536" />
                            <rotate angle="5.68065">
                                <axis x="1.37439e-008" y="0.982929" z="0.183988" />
                            </rotate>
                        </keyframe>
                        <keyframe time="0.479167">
                            <translate x="0" y="0.0458412" z="-11.6619" />
                            <rotate angle="5.17882">
                                <axis x="-1.12722e-008" y="0.93108" z="0.364815" />
                            </rotate>
                        </keyframe>
                        <keyframe time="0.71875">
                            <translate x="0" y="1.7174" z="-5.50479" />
                            <rotate angle="5.75361">
                                <axis x="9.25608e-009" y="0.987027" z="0.160556" />
                            </rotate>
                        </keyframe>
                        <keyframe time="0.958333">
                            <translate x="0" y="0" z="0" />
                            <rotate angle="0">
                                <axis x="1" y="0" z="0" />
                            </rotate>
                        </keyframe>
                    </keyframes>
                </track>






#77
1, maya2012, make a scene with 2 objects:
    a, a dog - with pose animation and skin animation.
    b, a  rock - none animation.

2, OgreMax exporter:
   a, only export the dog, everything is ok when running on the phone.
   b, use maya to combine dog and rock to 1 object, then export the conbined-object, then convert it to .bones, then run on the phone.
        b.1 play pose animation: ok
        b.2 play skin animation: error like this:

07-24 15:44:04.624: E/AndroidRuntime(7086): FATAL EXCEPTION: GLThread 10
07-24 15:44:04.624: E/AndroidRuntime(7086): java.lang.ArrayIndexOutOfBoundsException
07-24 15:44:04.624: E/AndroidRuntime(7086):    at raft.jpct.bones.Animated3D.applySkeletonPose(Animated3D.java:467)
07-24 15:44:04.624: E/AndroidRuntime(7086):    at raft.jpct.bones.AnimatedGroup.animateSkin(AnimatedGroup.java:178)
07-24 15:44:04.624: E/AndroidRuntime(7086):    at bones.samples.android.NinjaDemoActivity$MyRenderer.onDrawFrame(NinjaDemoActivity.java:599)
07-24 15:44:04.624: E/AndroidRuntime(7086):    at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1363)
07-24 15:44:04.624: E/AndroidRuntime(7086):    at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1118)


3,
#78
Bones / Does Bones support pose animation?
July 21, 2012, 08:17:20 AM
I used Maya-blend-shape to make an animation, then used ogreMax to export it(Object-settings: Skeleton+pose), and there were no skeleton-animation-data in .skeleton.xml but some pose-naimation-data in .mesh.xml.  And then i converted .mesh.xml to .bones(can.bones), when i tried to run it with ninja-demo-src, crash happened.

log-cat-info:

07-21 13:55:47.266: E/AndroidRuntime(2978): FATAL EXCEPTION: main
07-21 13:55:47.266: E/AndroidRuntime(2978): java.lang.NullPointerException
07-21 13:55:47.266: E/AndroidRuntime(2978):    at bones.samples.android.NinjaDemoActivity.onCreateOptionsMenu(NinjaDemoActivity.java:350)
07-21 13:55:47.266: E/AndroidRuntime(2978):    at android.app.Activity.onCreatePanelMenu(Activity.java:2158)


And my code in NinjaDemoActivity.java:350: 

public boolean onCreateOptionsMenu(Menu menu)                           // line 341
  {
    menu.add(0, MENU_STOP_ANIM, 0, "Stop Animation");

    if(MESH_ANIM_ALLOWED)
      menu.add(0, MENU_USE_MESH_ANIM, 0, "Use Mesh Animation").setCheckable(true);

    SubMenu animMenu = menu.addSubMenu("Animation");
    int menuItem = 101;
    for(SkinClip clip : masterNinja.getSkinClipSequence())               //line 350,   and init code: masterNinja = BonesIO.loadGroup(res.openRawResource(R.raw.can));
    {
      animMenu.add(0, menuItem++, 1, "Anim: " + clip.getName());
    }

    return true;
  }

#79
Bones / Error: Ogre .mesh.xml -> .bones
July 20, 2012, 04:50:34 AM
Converting .mesh.xml to .bones, error hanppend.
How to resolve it? Thanks!
Info:

Warning:  Rotation axis not normalized
com.jmex.model.ogrexml.anim.SkeletonLoader loadSkele

// Many similar Warning.....

-- total 64 joint(s) --
0 name: CZ_scens09:dog_rigging_finshed_ok:br_bone, parent:
1 name: CZ_scens09:dog_rigging_finshed_ok:joint52, parent:
2 name: CZ_scens09:dog_rigging_finshed_ok:joint1, parent: 0:CZ_scens09:dog_rigg
ng_finshed_ok:br_bone
3 name: CZ_scens09:dog_rigging_finshed_ok:joint_zong, parent: 0:CZ_scens09:dog_
igging_finshed_ok:br_bone
4 name: CZ_scens09:dog_rigging_finshed_ok:veter_a, parent: 0:CZ_scens09:dog_rig
ing_finshed_ok:br_bone
5 name: CZ_scens09:dog_rigging_finshed_ok:joint53, parent: 1:CZ_scens09:dog_rig
ing_finshed_ok:joint52
6 name: CZ_scens09:dog_rigging_finshed_ok:joint2, parent: 2:CZ_scens09:dog_rigg
ng_finshed_ok:joint1
7 name: CZ_scens09:dog_rigging_finshed_ok:joint5, parent: 3:CZ_scens09:dog_rigg
ng_finshed_ok:joint_zong
8 name: CZ_scens09:dog_rigging_finshed_ok:joint73, parent: 3:CZ_scens09:dog_rig
ing_finshed_ok:joint_zong
9 name: CZ_scens09:dog_rigging_finshed_ok:veter_b, parent: 4:CZ_scens09:dog_rig
ing_finshed_ok:veter_a
10 name: CZ_scens09:dog_rigging_finshed_ok:joint54, parent: 5:CZ_scens09:dog_ri
ging_finshed_ok:joint53
11 name: CZ_scens09:dog_rigging_finshed_ok:joint3, parent: 6:CZ_scens09:dog_rig
ing_finshed_ok:joint2
12 name: CZ_scens09:dog_rigging_finshed_ok:joint6, parent: 7:CZ_scens09:dog_rig
ing_finshed_ok:joint5
13 name: CZ_scens09:dog_rigging_finshed_ok:joint74, parent: 8:CZ_scens09:dog_ri
ging_finshed_ok:joint73
14 name: CZ_scens09:dog_rigging_finshed_ok:veter_c, parent: 9:CZ_scens09:dog_ri
ging_finshed_ok:veter_b
15 name: CZ_scens09:dog_rigging_finshed_ok:joint55, parent: 10:CZ_scens09:dog_r
gging_finshed_ok:joint54
16 name: CZ_scens09:dog_rigging_finshed_ok:joint4, parent: 11:CZ_scens09:dog_ri
ging_finshed_ok:joint3
17 name: CZ_scens09:dog_rigging_finshed_ok:joint81, parent: 12:CZ_scens09:dog_r
gging_finshed_ok:joint6
18 name: CZ_scens09:dog_rigging_finshed_ok:joint80, parent: 13:CZ_scens09:dog_r
gging_finshed_ok:joint74
19 name: CZ_scens09:dog_rigging_finshed_ok:veter_d, parent: 14:CZ_scens09:dog_r
gging_finshed_ok:veter_c
20 name: CZ_scens09:dog_rigging_finshed_ok:joint56, parent: 15:CZ_scens09:dog_r
gging_finshed_ok:joint55
21 name: CZ_scens09:dog_rigging_finshed_ok:joint11, parent: 16:CZ_scens09:dog_r
gging_finshed_ok:joint4
22 name: CZ_scens09:dog_rigging_finshed_ok:joint38, parent: 16:CZ_scens09:dog_r
gging_finshed_ok:joint4
23 name: CZ_scens09:dog_rigging_finshed_ok:joint61, parent: 16:CZ_scens09:dog_r
gging_finshed_ok:joint4
24 name: CZ_scens09:dog_rigging_finshed_ok:joint82, parent: 17:CZ_scens09:dog_r
gging_finshed_ok:joint81
25 name: CZ_scens09:dog_rigging_finshed_ok:joint79, parent: 18:CZ_scens09:dog_r
gging_finshed_ok:joint80
26 name: CZ_scens09:dog_rigging_finshed_ok:joint57, parent: 20:CZ_scens09:dog_r
gging_finshed_ok:joint56
27 name: CZ_scens09:dog_rigging_finshed_ok:joint12, parent: 21:CZ_scens09:dog_r
gging_finshed_ok:joint11
28 name: CZ_scens09:dog_rigging_finshed_ok:joint39, parent: 22:CZ_scens09:dog_r
gging_finshed_ok:joint38
29 name: CZ_scens09:dog_rigging_finshed_ok:joint16, parent: 23:CZ_scens09:dog_r
gging_finshed_ok:joint61
30 name: CZ_scens09:dog_rigging_finshed_ok:joint83, parent: 24:CZ_scens09:dog_r
gging_finshed_ok:joint82
31 name: CZ_scens09:dog_rigging_finshed_ok:joint77, parent: 25:CZ_scens09:dog_r
gging_finshed_ok:joint79
32 name: CZ_scens09:dog_rigging_finshed_ok:joint58, parent: 26:CZ_scens09:dog_r
gging_finshed_ok:joint57
33 name: CZ_scens09:dog_rigging_finshed_ok:joint13, parent: 27:CZ_scens09:dog_r
gging_finshed_ok:joint12
34 name: CZ_scens09:dog_rigging_finshed_ok:joint40, parent: 28:CZ_scens09:dog_r
gging_finshed_ok:joint39
35 name: CZ_scens09:dog_rigging_finshed_ok:joint17, parent: 29:CZ_scens09:dog_r
gging_finshed_ok:joint16
36 name: CZ_scens09:dog_rigging_finshed_ok:joint59, parent: 32:CZ_scens09:dog_r
gging_finshed_ok:joint58
37 name: CZ_scens09:dog_rigging_finshed_ok:joint14, parent: 33:CZ_scens09:dog_r
gging_finshed_ok:joint13
38 name: CZ_scens09:dog_rigging_finshed_ok:joint41, parent: 34:CZ_scens09:dog_r
gging_finshed_ok:joint40
39 name: CZ_scens09:dog_rigging_finshed_ok:joint18, parent: 35:CZ_scens09:dog_r
gging_finshed_ok:joint17
40 name: CZ_scens09:dog_rigging_finshed_ok:joint60, parent: 36:CZ_scens09:dog_r
gging_finshed_ok:joint59
41 name: CZ_scens09:dog_rigging_finshed_ok:joint15, parent: 37:CZ_scens09:dog_r
gging_finshed_ok:joint14
42 name: CZ_scens09:dog_rigging_finshed_ok:joint42, parent: 38:CZ_scens09:dog_r
gging_finshed_ok:joint41
43 name: CZ_scens09:dog_rigging_finshed_ok:joint50, parent: 39:CZ_scens09:dog_r
gging_finshed_ok:joint18
44 name: CZ_scens09:dog_rigging_finshed_ok:joint49, parent: 39:CZ_scens09:dog_r
gging_finshed_ok:joint18
45 name: CZ_scens09:dog_rigging_finshed_ok:joint19, parent: 39:CZ_scens09:dog_r
gging_finshed_ok:joint18
46 name: CZ_scens09:dog_rigging_finshed_ok:joint33, parent: 39:CZ_scens09:dog_r
gging_finshed_ok:joint18
47 name: CZ_scens09:dog_rigging_finshed_ok:joint62, parent: 39:CZ_scens09:dog_r
gging_finshed_ok:joint18
48 name: CZ_scens09:dog_rigging_finshed_ok:joint51, parent: 43:CZ_scens09:dog_r
gging_finshed_ok:joint50
49 name: CZ_scens09:dog_rigging_finshed_ok:joint20, parent: 45:CZ_scens09:dog_r
gging_finshed_ok:joint19
50 name: CZ_scens09:dog_rigging_finshed_ok:joint34, parent: 46:CZ_scens09:dog_r
gging_finshed_ok:joint33
51 name: CZ_scens09:dog_rigging_finshed_ok:joint63, parent: 47:CZ_scens09:dog_r
gging_finshed_ok:joint62
52 name: CZ_scens09:dog_rigging_finshed_ok:joint21, parent: 49:CZ_scens09:dog_r
gging_finshed_ok:joint20
53 name: CZ_scens09:dog_rigging_finshed_ok:joint35, parent: 50:CZ_scens09:dog_r
gging_finshed_ok:joint34
54 name: CZ_scens09:dog_rigging_finshed_ok:joint64, parent: 51:CZ_scens09:dog_r
gging_finshed_ok:joint63
55 name: CZ_scens09:dog_rigging_finshed_ok:joint22, parent: 52:CZ_scens09:dog_r
gging_finshed_ok:joint21
56 name: CZ_scens09:dog_rigging_finshed_ok:joint36, parent: 53:CZ_scens09:dog_r
gging_finshed_ok:joint35
57 name: CZ_scens09:dog_rigging_finshed_ok:joint65, parent: 54:CZ_scens09:dog_r
gging_finshed_ok:joint64
58 name: CZ_scens09:dog_rigging_finshed_ok:joint23, parent: 55:CZ_scens09:dog_r
gging_finshed_ok:joint22
59 name: CZ_scens09:dog_rigging_finshed_ok:joint37, parent: 56:CZ_scens09:dog_r
gging_finshed_ok:joint36
60 name: CZ_scens09:dog_rigging_finshed_ok:joint66, parent: 57:CZ_scens09:dog_r
gging_finshed_ok:joint65
61 name: CZ_scens09:dog_rigging_finshed_ok:joint67, parent: 60:CZ_scens09:dog_r
gging_finshed_ok:joint66
62 name: CZ_scens09:dog_rigging_finshed_ok:joint68, parent: 61:CZ_scens09:dog_r
gging_finshed_ok:joint67
63 name: CZ_scens09:dog_rigging_finshed_ok:joint69, parent: 62:CZ_scens09:dog_r
gging_finshed_ok:joint68
-- --
Skeleton created out of jME OGRE skeleton, 64 joints
[ Fri Jul 20 10:22:21 CST 2012 ] - WARNING: skipping null TexCoords
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 731
        at com.threed.jpct.Object3D.<init>(Unknown Source)
        at raft.jpct.bones.Animated3D.<init>(Animated3D.java:120)
        at raft.jpct.bones.BonesImporter.importOgre(BonesImporter.java:199)
        at raft.jpct.bones.util.JMEOgreImporter.loadGroup(JMEOgreImporter.java:
12)
        at raft.jpct.bones.util.JMEOgreImporter.loadGroup(JMEOgreImporter.java:
8)
        at raft.jpct.bones.util.JMEOgreImporter.run(JMEOgreImporter.java:69)
        at raft.jpct.bones.util.JMEOgreImporter.main(JMEOgreImporter.java:170)
#80
Hi all:

  I download Ninja demo, which provided a demo-apk and demo-src.

  First, i installed demo-apk on my phone, it run fast.(40 fps avg in mesh and skin animation).
  Then i import demo-src-project in eclipse,  build and installed on my phone, it run very slow!(only 3-8 fps in mesh animation).

   Why?
 
   There are what i did with the demo-src :

   1, import ninja-demo-src-project in eclipse.
   2, download Bone-api-src, and import it in ninja-demo-src-project.
   3, delete package: raft\jpct\bones\util,  delete raft\jpct\bones\BonesImporter.java
   4, set android-sdk-version: 2.3.3
   5, use jpct-ae-1.23-beta.jar which is included by ninja demo.
   
And when i entry Ninja-demo(src-build-demo),  the loading time is very long(1 minute), log-cat:

07-19 13:16:04.773: I/jPCT-AE(13394): onCreate
07-19 13:16:04.929: D/szipinf(13394): Initializing inflate state
07-19 13:16:04.937: I/jPCT-AE(13394): Wrapping input stream in a BufferedInputStream
07-19 13:16:04.937: D/szipinf(13394): Initializing zlib to inflate
07-19 13:16:23.039: D/dalvikvm(13394): GC_CONCURRENT freed 1176K, 24% free 14733K/19207K, external 3875K/4103K, paused 4ms+7ms
07-19 13:16:41.820: D/dalvikvm(13394): GC_CONCURRENT freed 1481K, 21% free 15182K/19207K, external 3875K/4103K, paused 4ms+8ms
07-19 13:16:58.781: D/dalvikvm(13394): GC_CONCURRENT freed 2127K, 24% free 15086K/19655K, external 3875K/4103K, paused 4ms+7ms
07-19 13:17:00.281: D/dalvikvm(13394): GC_FOR_MALLOC freed 472K, 23% free 15136K/19655K, external 3875K/4103K, paused 80ms
07-19 13:17:01.789: D/dalvikvm(13394): GC_FOR_MALLOC freed 485K, 23% free 15158K/19655K, external 3875K/4103K, paused 80ms
07-19 13:17:02.976: D/dalvikvm(13394): GC_FOR_MALLOC freed 357K, 23% free 15253K/19655K, external 3875K/4103K, paused 82ms
07-19 13:17:04.468: D/dalvikvm(13394): GC_FOR_MALLOC freed 484K, 23% free 15302K/19783K, external 3875K/4103K, paused 80ms
07-19 13:17:05.687: D/dalvikvm(13394): GC_FOR_MALLOC freed 357K, 23% free 15387K/19783K, external 3875K/4103K, paused 81ms
07-19 13:17:07.187: D/dalvikvm(13394): GC_FOR_MALLOC freed 484K, 23% free 15447K/19911K, external 3875K/4103K, paused 81ms
07-19 13:17:08.734: D/dalvikvm(13394): GC_FOR_MALLOC freed 479K, 23% free 15524K/19975K, external 3875K/4103K, paused 80ms
07-19 13:17:09.921: D/dalvikvm(13394): GC_FOR_MALLOC freed 362K, 22% free 15669K/20039K, external 3875K/4103K, paused 80ms
07-19 13:17:11.382: D/dalvikvm(13394): GC_FOR_MALLOC freed 484K, 23% free 15716K/20167K, external 3875K/4103K, paused 81ms
07-19 13:17:12.937: D/dalvikvm(13394): GC_FOR_MALLOC freed 479K, 22% free 15782K/20231K, external 3875K/4103K, paused 82ms
07-19 13:17:14.437: D/dalvikvm(13394): GC_FOR_MALLOC freed 484K, 22% free 15849K/20295K, external 3875K/4103K, paused 81ms
07-19 13:17:15.968: D/dalvikvm(13394): GC_FOR_MALLOC freed 479K, 22% free 15915K/20359K, external 3875K/4103K, paused 82ms
07-19 13:17:17.125: D/dalvikvm(13394): GC_FOR_MALLOC freed 363K, 22% free 16053K/20423K, external 3875K/4103K, paused 80ms
07-19 13:17:18.671: D/dalvikvm(13394): GC_FOR_MALLOC freed 484K, 22% free 16097K/20551K, external 3875K/4103K, paused 81ms
07-19 13:17:20.164: D/dalvikvm(13394): GC_FOR_MALLOC freed 478K, 22% free 16164K/20615K, external 3875K/4103K, paused 86ms
07-19 13:17:21.726: D/dalvikvm(13394): GC_FOR_MALLOC freed 484K, 22% free 16230K/20679K, external 3875K/4103K, paused 81ms
07-19 13:17:22.898: D/dalvikvm(13394): GC_FOR_MALLOC freed 357K, 22% free 16369K/20743K, external 3875K/4103K, paused 81ms
07-19 13:17:24.429: D/dalvikvm(13394): GC_FOR_MALLOC freed 485K, 22% free 16416K/20871K, external 3875K/4103K, paused 81ms
07-19 13:17:25.953: D/dalvikvm(13394): GC_FOR_MALLOC freed 478K, 22% free 16484K/20935K, external 3875K/4103K, paused 83ms
07-19 13:17:27.492: D/dalvikvm(13394): GC_FOR_MALLOC freed 485K, 22% free 16538K/20999K, external 3875K/4103K, paused 81ms
07-19 13:17:29.000: D/dalvikvm(13394): GC_FOR_MALLOC freed 478K, 22% free 16616K/21063K, external 3875K/4103K, paused 82ms
07-19 13:17:30.265: D/dalvikvm(13394): GC_FOR_MALLOC freed 363K, 21% free 16751K/21127K, external 3875K/4103K, paused 80ms
07-19 13:17:31.742: D/dalvikvm(13394): GC_FOR_MALLOC freed 485K, 21% free 16797K/21255K, external 3875K/4103K, paused 81ms
07-19 13:17:33.296: D/dalvikvm(13394): GC_FOR_MALLOC freed 478K, 21% free 16864K/21319K, external 3875K/4103K, paused 134ms
07-19 13:17:34.796: D/dalvikvm(13394): GC_FOR_MALLOC freed 485K, 21% free 16919K/21383K, external 3875K/4103K, paused 82ms
07-19 13:17:35.960: D/dalvikvm(13394): GC_FOR_MALLOC freed 357K, 21% free 17066K/21447K, external 3875K/4103K, paused 82ms
07-19 13:17:37.484: D/dalvikvm(13394): GC_FOR_MALLOC freed 485K, 21% free 17117K/21575K, external 3875K/4103K, paused 82ms
07-19 13:17:38.953: D/dalvikvm(13394): GC_FOR_MALLOC freed 478K, 21% free 17184K/21639K, external 3875K/4103K, paused 83ms
07-19 13:17:40.507: D/dalvikvm(13394): GC_FOR_MALLOC freed 485K, 21% free 17239K/21703K, external 3875K/4103K, paused 87ms
07-19 13:17:42.000: D/dalvikvm(13394): GC_FOR_MALLOC freed 478K, 21% free 17317K/21767K, external 3875K/4103K, paused 87ms
07-19 13:17:43.234: D/dalvikvm(13394): GC_FOR_MALLOC freed 363K, 21% free 17452K/21831K, external 3875K/4103K, paused 84ms
07-19 13:17:44.687: D/dalvikvm(13394): GC_FOR_MALLOC freed 485K, 21% free 17498K/21959K, external 3875K/4103K, paused 81ms
07-19 13:17:46.226: D/dalvikvm(13394): GC_FOR_MALLOC freed 478K, 21% free 17565K/22023K, external 3875K/4103K, paused 82ms
07-19 13:17:47.726: D/dalvikvm(13394): GC_FOR_MALLOC freed 485K, 21% free 17620K/22087K, external 3875K/4103K, paused 82ms
07-19 13:17:48.945: D/dalvikvm(13394): GC_FOR_MALLOC freed 357K, 20% free 17770K/22151K, external 3875K/4103K, paused 82ms
07-19 13:17:50.398: D/dalvikvm(13394): GC_FOR_MALLOC freed 485K, 21% free 17818K/22279K, external 3875K/4103K, paused 83ms
07-19 13:17:51.953: D/dalvikvm(13394): GC_FOR_MALLOC freed 478K, 20% free 17885K/22343K, external 3875K/4103K, paused 83ms
07-19 13:17:53.000: I/jPCT-AE(13394): created mesh keyframes, 144x2
07-19 13:17:53.093: D/dalvikvm(13394): GC_FOR_MALLOC freed 364K, 20% free 18026K/22407K, external 3875K/4103K, paused 83ms
07-19 13:17:56.078: I/jPCT-AE(13394): added new ninja: 1
07-19 13:17:56.085: I/jPCT-AE(13394): Adding Lightsource: 0
07-19 13:17:56.093: I/jPCT-AE(13394): onResume
07-19 13:17:56.242: D/GC(13394): <tid=13501> GC Version   : GC Ver0.8.0.4026-TD-Gingerbread-Beta5-SP4
07-19 13:17:56.257: I/jPCT-AE(13394): onSurfaceCreated
07-19 13:17:56.273: I/jPCT-AE(13394): Loading Texture...
07-19 13:17:56.281: D/skia(13394): JPEG Decode kDecodePixels_Mode
07-19 13:17:56.562: D/dalvikvm(13394): GC_EXTERNAL_ALLOC freed 575K, 20% free 18144K/22407K, external 3875K/4103K, paused 280ms
07-19 13:17:56.640: D/skia(13394): ---- Time (ms): IPP JPEG Decode 364
07-19 13:17:56.726: D/dalvikvm(13394): GC_FOR_MALLOC freed <1K, 20% free 18144K/22407K, external 4387K/5478K, paused 84ms
07-19 13:17:56.734: I/dalvikvm-heap(13394): Grow heap (frag case) to 25.371MB for 1048592-byte allocation
07-19 13:17:56.843: D/dalvikvm(13394): GC_FOR_MALLOC freed <1K, 19% free 19168K/23495K, external 4387K/5478K, paused 82ms
07-19 13:17:58.210: I/jPCT-AE(13394): Loading Texture...
07-19 13:17:58.234: I/jPCT-AE(13394): Loading Texture...
07-19 13:17:58.234: I/jPCT-AE(13394): onSurfaceChanged
07-19 13:17:58.242: I/jPCT-AE(13394): OpenGL vendor:     Marvell Technology Group Ltd
07-19 13:17:58.250: I/jPCT-AE(13394): OpenGL renderer:   GC530 Graphics Engine
07-19 13:17:58.250: I/jPCT-AE(13394): OpenGL version:    OpenGL ES-CM 1.1
07-19 13:17:58.250: I/jPCT-AE(13394): OpenGL renderer initialized (using 4 texture stages)
07-19 13:18:02.320: I/jPCT-AE(13394): Remapping 781 vertex indices!
07-19 13:18:02.320: I/jPCT-AE(13394): Creating vertex cache (18744 bytes)!
07-19 13:18:02.359: I/jPCT-AE(13394): Vertex indices will be accessed directly!
07-19 13:18:02.367: I/jPCT-AE(13394): Subobject of object 19/object21 compiled to indexed fixed point data using 2712 vertices in 3114ms!
07-19 13:18:02.367: I/jPCT-AE(13394): Object 19/object21 compiled to 1 subobjects in 4097ms!
07-19 13:18:02.820: I/jPCT-AE(13394): Remapping 61 vertex indices!
07-19 13:18:02.820: I/jPCT-AE(13394): Creating vertex cache (1464 bytes)!
07-19 13:18:02.828: I/jPCT-AE(13394): Vertex indices will be accessed directly!
07-19 13:18:02.828: I/jPCT-AE(13394): Subobject of object 20/object22 compiled to indexed fixed point data using 312 vertices in 344ms!
07-19 13:18:02.828: I/jPCT-AE(13394): Object 20/object22 compiled to 1 subobjects in 457ms!
07-19 13:18:02.945: D/dalvikvm(13394): GC_EXTERNAL_ALLOC freed 257K, 18% free 19485K/23495K, external 3044K/3668K, paused 107ms
07-19 13:18:03.046: D/dalvikvm(13394): GC_FOR_MALLOC freed 3K, 18% free 19482K/23495K, external 3872K/4836K, paused 85ms
07-19 13:18:03.054: I/dalvikvm-heap(13394): Grow heap (frag case) to 26.175MB for 1048592-byte allocation
07-19 13:18:03.179: D/dalvikvm(13394): GC_FOR_MALLOC freed 4K, 17% free 20502K/24583K, external 3821K/4772K, paused 87ms