Author Topic: Runtime error on moveCamera / lookAt  (Read 2240 times)

Offline Enigmadt

  • byte
  • *
  • Posts: 2
    • View Profile
Runtime error on moveCamera / lookAt
« on: November 09, 2012, 09:15:28 am »
Hi,

i have made an app like HelloWorldAe.
When i compile this app it is ok but at runtime there is an error by moveCamera, lookAt or setPosition method.
If i comment out the lines with moveCamera, lookAt and setPosition then it's fine.
I have tested the HelloWorldAe example too and there is the same error.

Currently i'm at work. I post the error log when i get home.

Quote
11-09 18:55:10.017: W/dalvikvm(390): threadid=7: thread exiting with uncaught exception (group=0x4001d800)
11-09 18:55:10.017: E/AndroidRuntime(390): FATAL EXCEPTION: GLThread 8
11-09 18:55:10.017: E/AndroidRuntime(390): java.lang.NullPointerException
11-09 18:55:10.017: E/AndroidRuntime(390):    at com.enigmadt.earth.live.wallpaper.StartActivity$MyRenderer.onDrawFrame(StartActivity.java:83)
11-09 18:55:10.017: E/AndroidRuntime(390):    at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1332)
11-09 18:55:10.017: E/AndroidRuntime(390):    at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1116)

On line 83 is
Code: [Select]
cam.moveCamera(Camera.CAMERA_MOVEOUT, 1.0f);I have testet the app on the emulator and on HTC Desire.
Any idea how i can solve this problem?

regards   
« Last Edit: November 09, 2012, 08:07:30 pm by Enigmadt »

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Runtime error on moveCamera / lookAt
« Reply #1 on: November 09, 2012, 09:25:55 am »
It's impossible to tell without looking at the exception's stack trace. Might be that it simply can't find the class files. If that's the case, look here for a solution: http://www.jpct.net/forum2/index.php/topic,2663.0.html

Offline Enigmadt

  • byte
  • *
  • Posts: 2
    • View Profile
Re: Runtime error on moveCamera / lookAt
« Reply #2 on: November 10, 2012, 11:34:12 am »
I have solved my problem.
My mistake was that i called world.getCamera(); but getCamera return the Camera object so i got an empty Camera object.