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

Messages - elmatos

#1
Support / Re: Error Loading .obj file
October 01, 2013, 03:12:36 PM
It's working now! ;D

Thank you very much for the help  ;)
#2
Support / Error Loading .obj file
September 30, 2013, 08:29:51 PM
Hi there!

First of all i would like to thank the developer(s) for this awesome tool!

Now getting to the point of this post:

I was trying to load an .obj file like the title says but i'm having the following exception thrown:

09-30 18:03:48.067: E/AndroidRuntime(2378): FATAL EXCEPTION: GLThread 5227
09-30 18:03:48.067: E/AndroidRuntime(2378): java.lang.ArrayIndexOutOfBoundsException: length=8392; index=8392
09-30 18:03:48.067: E/AndroidRuntime(2378):    at com.threed.jpct.Loader.loadOBJ(Loader.java:386)
09-30 18:03:48.067: E/AndroidRuntime(2378):    at com.threed.jpct.Loader.loadOBJ(Loader.java:229)
09-30 18:03:48.067: E/AndroidRuntime(2378):    at com.project.MyClass$MyRenderer.onSurfaceChanged(object_3D.java:177)
09-30 18:03:48.067: E/AndroidRuntime(2378):    at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1512)
09-30 18:03:48.067: E/AndroidRuntime(2378):    at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1240)

I used the example class hello world and only changed some code on the onSurfaceChanged (see bellow)

if (fb != null) {
   fb.dispose();
}
fb = new FrameBuffer(gl, w, h);

if (master == null) {

   world = new World();
   world.setAmbientLight(20, 20, 20);

   sun = new Light(world);
   sun.setIntensity(250, 250, 250);

   // Create a texture
   Texture texture = new Texture(BitmapHelper.rescale(BitmapHelper.convert(getResources().getDrawable(R.drawable.objectTexture)), 64, 64));
   TextureManager.getInstance().addTexture("texture", texture);


   Object3D[] s = Loader.loadOBJ(getResources().openRawResource(R.raw.object3d), null, 1);  <<--Error occurs where
   Object3D = Object3D.mergeAll(s);
   Object3D.setTexture("texture");
   Object3D.strip();
   Object3D.build();
   
   world.addObject(Object3D);


   Camera cam = world.getCamera();

(unchanged content...)


The .obj file can de downloaded in the following link:
http://www35.zippyshare.com/v/24809331/file.html

I would be much appreciated for some help in this matter  :)