Author Topic: Integrating JPCT-AE with Vuforia  (Read 3223 times)

Offline ashunkhs

  • byte
  • *
  • Posts: 24
    • View Profile
Integrating JPCT-AE with Vuforia
« on: April 09, 2013, 10:26:57 am »
Hi Sir

 I am working fro Integrating JPCT-AE with Vuforia.  And  follow this link ....for help
 
 http://www.jpct.net/wiki/index.php/Integrating_JPCT-AE_with_Vuforia

 I did every thing same . I replace the letest  JPCT library also But my app is being cress in following line .

if (fb != null) {
         fb.dispose();
      }
      fb = new FrameBuffer(width, height);

 in  onSurfaceChanged(GL10 gl, int width, int height) methord.    and the error is  as................

04-09 08:16:48.110: E/AndroidRuntime(10749): FATAL EXCEPTION: GLThread 648
04-09 08:16:48.110: E/AndroidRuntime(10749): java.lang.RuntimeException: [ 1365495408106 ] - ERROR: java.lang.RuntimeException: [ 1365495408102 ] - ERROR: java.lang.RuntimeException: [ 1365495408100 ] - ERROR: Shaders are not supported when using OpenGL ES 1.x!
04-09 08:16:48.110: E/AndroidRuntime(10749):    at com.threed.jpct.Logger.log(Logger.java:189)
04-09 08:16:48.110: E/AndroidRuntime(10749):    at com.threed.jpct.GLSLShader.check20(GLSLShader.java:266)
04-09 08:16:48.110: E/AndroidRuntime(10749):    at com.threed.jpct.GLSLShader.<init>(GLSLShader.java:217)
04-09 08:16:48.110: E/AndroidRuntime(10749):    at com.threed.jpct.GL20.<init>(GL20.java:117)
04-09 08:16:48.110: E/AndroidRuntime(10749):    at java.lang.Class.newInstanceImpl(Native Method)
04-09 08:16:48.110: E/AndroidRuntime(10749):    at java.lang.Class.newInstance(Class.java:1319)




please check it out . what i have to do next..........?


regards
ashutosh

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Integrating JPCT-AE with Vuforia
« Reply #1 on: April 09, 2013, 03:26:14 pm »
Obviously, you are trying to use an OpenGL ES 2.0 renderer in a 1.x context. You should somehow check if your context is 1.x or 2.0 and create the framebuffer accordingly. Like the wiki says:

Quote
NOTE: You can use OpenGL 1.0 or 2.0. If you have a phone that supports 2.0, Vuforia will fire a 2.0 surface and thus creating a framebuffer for 1.0 will cause the app to crash. For simplicity I am posting here the code that corresponds to OpenGLES 2.0 framebuffer initialization. You can add a OGL version check here and create the FB in consequence. If you want to use 1.0 only, you can force Vuforia to do so by going into Android.mk file under jni folder and setting the USE_OPENGL_ES_1_1 directive to true. Then use the FrameBuffer(gl, width, height) constructor instead of the one I used (which corresponds to OGLES2.0)

Offline ashunkhs

  • byte
  • *
  • Posts: 24
    • View Profile
Re: Integrating JPCT-AE with Vuforia
« Reply #2 on: April 09, 2013, 03:41:04 pm »
Hi ,

 as  we know  the following constructor

          fb = new FrameBuffer(width, height); for Gl 2.0.
i do't need to pass the gl context to  FrameBuffer() constructor.
then why i am getting this error.

check out my  onSurfaceChanged methord(); where i am doing mistake

/** Called when the surface changed size. */
   public void onSurfaceChanged(GL10 gl, int width, int height)
   {
      // Call native function to update rendering when render surface parameters have changed:
      updateRendering(width, height);

      // Call QCAR function to handle render surface size changes:
      QCAR.onSurfaceChanged(width, height); .................................case 1

             QCAR.onSurfaceChanged(gl, width, height);............................................case2
      
      if (fb != null) {
           fb.dispose();
      }
      fb = new FrameBuffer(width, height);
   }

both cases i am getting error.pls check it out.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Integrating JPCT-AE with Vuforia
« Reply #3 on: April 09, 2013, 04:37:03 pm »
There's nothing for me to check out, i'm afraid. The constructor you are using is for 2.0. You obviously have no 2.0 context, but providing the context is out of the scope of the engine. It's up to you to check which kind of context you are getting from Vuforia and initialize the proper FrameBuffer.

Offline ashunkhs

  • byte
  • *
  • Posts: 24
    • View Profile
Re: Integrating JPCT-AE with Vuforia
« Reply #4 on: April 10, 2013, 12:43:24 pm »
 HI ,

   Now i a am able to render the cube on the surface in ImageTarget sample , but is still not same as tea-port model.
   it is still rotate there and there on the screen . i follow the all tricks provided by u by the following link.....
    http://www.jpct.net/wiki/index.php/Integrating_JPCT-AE_with_Vuforia
   
   i have set the FOV and FOVY also and further all the process i did i cube is not rendering as tea-port model.
   please help me out.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Integrating JPCT-AE with Vuforia
« Reply #5 on: April 10, 2013, 02:39:49 pm »
Try to PM kelmer (http://www.jpct.net/forum2/index.php?action=profile;u=2370) for an answer. Personally, i've no idea about this VR stuff...the wiki page was written by him.

Offline ashunkhs

  • byte
  • *
  • Posts: 24
    • View Profile
Re: Integrating JPCT-AE with Vuforia
« Reply #6 on: April 11, 2013, 03:00:48 pm »
Hi

thanks to JPCT .
Now i am able to render my model same as teaport .



thanks.