I am trying to load 3d models into my application using jPCT-AE . I read a few tutorials and I think I understand the basics, but I have not yet been able to integrate the 3d files that I have.
I use the code snippets that I found in the tutorials package com.example.jpct;
import java.io.IOException; import java.io.InputStream; import java.io.UnsupportedEncodingException; import java.lang.reflect.Field; import javax.microedition.khronos.egl.EGL10; import javax.microedition.khronos.egl.EGLConfig; import javax.microedition.khronos.egl.EGLDisplay; import javax.microedition.khronos.opengles.GL10; import android.app.Activity; import android.content.res.AssetManager; import android.opengl.GLSurfaceView; import android.os.Bundle; import android.view.MotionEvent; import com.threed.jpct.Camera; import com.threed.jpct.FrameBuffer; import com.threed.jpct.Light; import com.threed.jpct.Loader; import com.threed.jpct.Logger; import com.threed.jpct.Object3D; import com.threed.jpct.Primitives; import com.threed.jpct.RGBColor; import com.threed.jpct.SimpleVector; import com.threed.jpct.Texture; import com.threed.jpct.TextureManager; import com.threed.jpct.World; import com.threed.jpct.util.BitmapHelper; import com.threed.jpct.util.MemoryHelper; import java.io.*; import com.threed.jpct.*; import android.content.res.Resources; import android.opengl.GLSurfaceView.EGLConfigChooser; import android.opengl.GLSurfaceView.Renderer; import android.util.Log; public class MainActivity extends Activity {
So applications fail, here is my logCat
FATAL EXCEPTION: GLThread 93 java.lang.RuntimeException: [ 1363008600568 ] - ERROR: Not a valid 3DS file! at com.threed.jpct.Logger.log(Logger.java:189) at com.threed.jpct.Loader.load3DS(Loader.java:1554) at com.threed.jpct.Loader.load3DS(Loader.java:154) at com.example.jpct.MainActivity$MyRenderer.loadModel(MainActivity.java:269) at com.example.jpct.MainActivity$MyRenderer.onSurfaceChanged(MainActivity.java:207) at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1505) at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1240)
The 3D file is located in the "assets" folder and is a valid 3ds file (I tested it on another 3d engine).
Can you help me?
android eclipse 3d loading jpct
Romain
source share