Author Topic: problem in combining jpct with Qcar  (Read 1524 times)

Offline MrYogi

  • byte
  • *
  • Posts: 21
    • View Profile
problem in combining jpct with Qcar
« on: June 18, 2012, 07:46:53 am »
framebuffer fill error when i tried to combine jpct with Qcar.
i used sample of jpct but following error comes while rendering
Code: [Select]
06-18 11:05:00.578: E/AndroidRuntime(6524): java.lang.ArrayIndexOutOfBoundsException
06-18 11:05:00.578: E/AndroidRuntime(6524): at com.threed.jpct.CompiledInstance.fill(CompiledInstance.java:1159)
06-18 11:05:00.578: E/AndroidRuntime(6524): at com.threed.jpct.Object3DCompiler.compile(Object3DCompiler.java:145)
06-18 11:05:00.578: E/AndroidRuntime(6524): at com.threed.jpct.World.compile(World.java:1911)
06-18 11:05:00.578: E/AndroidRuntime(6524): at com.threed.jpct.World.renderScene(World.java:1035)
06-18 11:05:00.578: E/AndroidRuntime(6524): at com.qualcomm.QCARSamples.ImageTargets.jpct.onDrawFrame(Jpct.java:85)

can anyone tell why this is happening ,since i am new to jpct.
Jpct is seemed to be very promising rendering library as far as i known yet,so plz help me out,i'm stuck at this
thanks in advance :-[

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11749
    • View Profile
    • http://www.jpct.net
Re: problem in combining jpct with Qcar
« Reply #1 on: June 18, 2012, 08:22:47 am »
jPCT isn't thread-safe. Make sure that are not fiddling around with World, Object3D, Camera...from any other than the rendering thread. Or at least synchronize it with the rendering if you absolutely have to.

Offline MrYogi

  • byte
  • *
  • Posts: 21
    • View Profile
Re: problem in combining jpct with Qcar
« Reply #2 on: June 18, 2012, 12:21:40 pm »
jPCT isn't thread-safe. Make sure that are not fiddling around with World, Object3D, Camera...from any other than the rendering thread. Or at least synchronize it with the rendering if you absolutely have to.
i'm just testing your cube sample ,no other rendering thread is there.
and on googling i found that some people had succeded in integrating Qcar and Jpct,and by passing matrix values from qcar to jpct model is positioned according the image detection,can you plz help me out in this
« Last Edit: June 18, 2012, 12:25:22 pm by MrYogi »

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11749
    • View Profile
    • http://www.jpct.net
Re: problem in combining jpct with Qcar
« Reply #3 on: June 18, 2012, 12:48:09 pm »
I'm wasn't taking about another rendering thread (which isn't possible anyway)...but you are implicitely using a second thread, if you do stuff in an onXXXX-method for example.

Offline MrYogi

  • byte
  • *
  • Posts: 21
    • View Profile
Re: problem in combining jpct with Qcar
« Reply #4 on: June 18, 2012, 02:57:55 pm »
no i don't changed sample code for onDraw or any other,i am just using jpct render on separate GLSurfaceView that's all.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11749
    • View Profile
    • http://www.jpct.net
Re: problem in combining jpct with Qcar
« Reply #5 on: June 18, 2012, 03:05:23 pm »
I think we are talking about different things...can you post your modified code, if it isn't too large?

Offline MrYogi

  • byte
  • *
  • Posts: 21
    • View Profile
Re: problem in combining jpct with Qcar
« Reply #6 on: June 19, 2012, 06:39:16 am »
hi EgonOlsen,
thanks for your help,now jpct is rendering on Qcar .
now for my final goal i like to know that ,to draw model according to the modelview matrix i get from Qcar ,where should i pass matrix values in jpct?
and modelview matrix is enough or projection is also needed,and finally is any transformation also needed before passing the values.?
i know some people done that but i got no idea.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11749
    • View Profile
    • http://www.jpct.net
Re: problem in combining jpct with Qcar
« Reply #7 on: June 19, 2012, 07:04:24 am »
i know some people done that but i got no idea.
Neither do i...you should be able to find some working example in particular sticky thread.