jPCT-AE - a 3d engine for Android > Support

JPCT-AE error loading models (.md2, .3ds ...)[SOLVED]

(1/4) > >>

PaniX:
Hello guys,
as I'm an Android and JPCT-AE noob, I have to ask something.
I'm currently playing a little bit around with the HelloWorld-AE example, and found a problem.
The normal

--- Code: ---cube = Primitives.getCube(10.0f);
cube.calcTextureWrap();
cube.setTexture("texture");
cube.strip();
cube.build();
--- End code ---
method works. But when I try to load my own Model instead, like this:

--- Code: ---cube = Loader.loadMD2(getResource().openRawResource(R.raw.gun), 0.5f);
//cube = Primitives.getCube(10.0f);
cube.calcTextureWrap();
cube.setTexture("texture");
cube.strip();
cube.build();
--- End code ---
the Application crashs. I'm not sure why, as it worked already for me. The same happens when I try to load a 3DS file, like it's written in the wiki.
Does someone knows what's the problem?
Thanks
PaniX

EgonOlsen:
Impossible to tell unless you post the actual exception too.

PaniX:
The logcat doesn't help either:

--- Code: ---Android Log: Sep 16, 2013 06:21:28 +0200 - I/ActivityManager(  236): START {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10304000 cmp=free.codeninja.theone/.MainActivity} from pid 314
I/ActivityManager(  236): Start proc free.codeninja.theone for activity free.codeninja.theone/.MainActivity: pid=1259 uid=10085 gids={}
I/ActivityManager(  236): Displayed free.codeninja.theone/.MainActivity: +657ms
E/AndroidRuntime( 1259): at free.codeninja.theone.MainActivity$MyRenderer.onSurfaceChanged(MainActivity.java:175)
W/ActivityManager(  236):   Force finishing activity free.codeninja.theone/.MainActivity
I/ActivityManager(  236): Process free.codeninja.theone (pid 1259) has died.

--- End code ---

EgonOlsen:
That can't be everything. Are you by any chance swallowing some exception in your code?

PaniX:
May it be that there is something wrong with the inputstream? Not the object, I mean in the code? A wrong import? I'm not sure, but I think I've changed something in the imports.

Navigation

[0] Message Index

[#] Next page

Go to full version