Bones - Skeletal and Pose Animations for jPCT/jPCT-AE > Bones

Loading Bones on Android

(1/14) > >>

AGP:
Assuming this is right (on the desktop app to save the bones file):

--- Code: ---     private void saveToBones(String outFileName) {
FileOutputStream outStream = null;
try {
     outStream = new FileOutputStream(outFileName);
     BonesIO.saveGroup(animatedGroup, outStream);
     outStream.close();
}
catch (FileNotFoundException e) {System.err.println("File Not Found Problem: "+e.getMessage());}
catch (IOException e) {System.err.println("IO Problem: "+e.getMessage());}
     }

--- End code ---

createAnimatedGroup() should look like:

--- Code: --- protected AnimatedGroup createAnimatedGroup() throws Exception {
AnimatedGroup animatedGroup = BonesIO.loadGroup(getResources().openRawResource(R.raw.andersonbones));

Texture texture = new Texture(getResources().openRawResource(R.raw.andersondiffuse));
TextureManager.getInstance().addTexture("texture", texture);

for (Animated3D o : animatedGroup) {
o.setTexture("texture");
o.build();
o.discardMeshData();
}
return animatedGroup;
}

--- End code ---

Right? But this isn't working on my phone. I also tried

--- Code: --- AnimatedGroup animatedGroup = BonesIO.loadGroup(new FileInputStream(objectFileName));

--- End code ---
on the desktop, but it crashes. I should point out that the .bones file looks about right at 2241 KB. I appreciate any insights.

raft:
post logs and stack trace please

AGP:
Actually, I got it to a point in which it no longer crashes. But try as I might I can't get the camera to see it.

I've tried NOT calling discardMeshData() and specifically setting each Animated3D instance to setVisibility(true). Nothing works, but it looks a lot like it should. I even called calcNormals() just to be sure and that didn't make it visible either.

But, by the way,    

--- Code: ---AnimatedGroup animatedGroup = BonesIO.loadGroup(new FileInputStream(objectFileName));

--- End code ---
is now working. But the same file still doesn't load on my phone. And the same camera is on both versions (camera should see the same thing but it shows nothing on phone version).

AGP:
Now, I've also played with the near and far plane. To sum up:
-I'm seeing the "world" (the FrameBuffer's background color is being drawn) but not the model
-It's not crashing
-The file works and is visible on the PC version
-The camera is in the exact same position as the one on the PC version
-Config.maxPolysVisible > number of polys on the model
-near and far planes are very small and very large respectively
I have nothing left to try as far as I can tell (even the normals don't seem to be the problem). Help?

EgonOlsen:

--- Quote from: AGP on August 29, 2011, 08:59:11 pm ----Config.maxPolysVisible > number of polys on the model

--- End quote ---
This isn't related to your problem, but i though i should mention it: This is wasteful. For the Android version, you don't have to reserve that much space, because it doesn't really stand for polygons anymore (but the naming stayed the same for compatibility reasons) but for compiled object parts. An object with 32,000 polygons can very well get away with 4 entries in that structure instead of 32,000.

I'll adjust the docs for this setting.

Navigation

[0] Message Index

[#] Next page

Go to full version