当rajawali解析obj时无法启动活动

时间:2014-11-18 15:37:04

标签: android .obj rajawali

我将此rajawali tutorial导入到立体渲染器的工作示例中。我插入rajawali代码的类基于此API文档中的AbstractRenderer。导入.obj文件是可以的,但是一旦我开始用“objParser.parse();”解析我得到了失败:“无法启动活动”“NUllPointerException”因此,我是Android的新手,我真的迷失了。任何帮助都是礼物!非常感谢你! 我还添加了LogCat

11-18 23:16:42.359: E/libEGL(6495): call to OpenGL ES API with no current context (logged once per thread)
11-18 23:16:42.359: E/libEGL(6495): call to OpenGL ES API with no current context (logged once per thread)
11-18 23:16:42.359: E/libEGL(6495): call to OpenGL ES API with no current context (logged once per thread)
11-18 23:16:42.359: E/libEGL(6495): call to OpenGL ES API with no current context (logged once per thread)
11-18 23:16:42.359: D/AndroidRuntime(6495): Shutting down VM
11-18 23:16:42.359: W/dalvikvm(6495): threadid=1: thread exiting with uncaught exception (group=0x40a6d1f8)
11-18 23:16:42.359: E/AndroidRuntime(6495): FATAL EXCEPTION: main
11-18 23:16:42.359: E/AndroidRuntime(6495): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.sungame.sdeck.sample/com.sungame.sdeck.sample.SampleActivity}: java.lang.NullPointerException
11-18 23:16:42.359: E/AndroidRuntime(6495):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1956)
11-18 23:16:42.359: E/AndroidRuntime(6495):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
11-18 23:16:42.359: E/AndroidRuntime(6495):     at android.app.ActivityThread.access$600(ActivityThread.java:123)
11-18 23:16:42.359: E/AndroidRuntime(6495):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
11-18 23:16:42.359: E/AndroidRuntime(6495):     at android.os.Handler.dispatchMessage(Handler.java:99)
11-18 23:16:42.359: E/AndroidRuntime(6495):     at android.os.Looper.loop(Looper.java:137)
11-18 23:16:42.359: E/AndroidRuntime(6495):     at android.app.ActivityThread.main(ActivityThread.java:4424)
11-18 23:16:42.359: E/AndroidRuntime(6495):     at java.lang.reflect.Method.invokeNative(Native Method)
11-18 23:16:42.359: E/AndroidRuntime(6495):     at java.lang.reflect.Method.invoke(Method.java:511)
11-18 23:16:42.359: E/AndroidRuntime(6495):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
11-18 23:16:42.359: E/AndroidRuntime(6495):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
11-18 23:16:42.359: E/AndroidRuntime(6495):     at dalvik.system.NativeStart.main(Native Method)
11-18 23:16:42.359: E/AndroidRuntime(6495): Caused by: java.lang.NullPointerException
11-18 23:16:42.359: E/AndroidRuntime(6495):     at rajawali.materials.MaterialManager.addMaterial(MaterialManager.java:49)
11-18 23:16:42.359: E/AndroidRuntime(6495):     at rajawali.Object3D.setMaterial(Object3D.java:568)
11-18 23:16:42.359: E/AndroidRuntime(6495):     at rajawali.parser.LoaderOBJ$MaterialLib.setMaterial(LoaderOBJ.java:634)
11-18 23:16:42.359: E/AndroidRuntime(6495):     at rajawali.parser.LoaderOBJ.parse(LoaderOBJ.java:338)
11-18 23:16:42.359: E/AndroidRuntime(6495):     at com.sungame.sdeck.sample.render.StereoRenderer.<init>(StereoRenderer.java:86)
11-18 23:16:42.359: E/AndroidRuntime(6495):     at com.sungame.sdeck.sample.SampleActivity.onCreate(SampleActivity.java:52)
11-18 23:16:42.359: E/AndroidRuntime(6495):     at android.app.Activity.performCreate(Activity.java:4465)
11-18 23:16:42.359: E/AndroidRuntime(6495):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
11-18 23:16:42.359: E/AndroidRuntime(6495):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920)
11-18 23:16:42.359: E/AndroidRuntime(6495):     ... 11 more
11-18 23:16:42.757: I/dalvikvm(6495): threadid=3: reacting to signal 3
11-18 23:16:42.757: I/dalvikvm(6495): Wrote stack traces to '/data/anr/traces.txt'
11-18 23:16:42.898: I/dalvikvm(6495): threadid=3: reacting to signal 3
11-18 23:16:42.898: I/dalvikvm(6495): Wrote stack traces to '/data/anr/traces.txt'

0 个答案:

没有答案