Author Topic: Projection Matrix jpct+Vuforia  (Read 1234 times)

Offline nima.sh23

  • byte
  • *
  • Posts: 40
    • View Profile
Projection Matrix jpct+Vuforia
« on: September 21, 2015, 10:18:19 am »
I using Jpct-AE and Vuforia for make AR application.
For render 2D and Video I don't have any problem but for render 3D file (using Jpct-AE) I have a problem with Projection Matrix.
I know Jpct doesn't set projection matrix:
http://www.jpct.net/forum2/index.php/topic,2368.msg17437.html#msg17437
But I need a solution for solve this.
In Open GL I can use of projection Matrix but in jpct I don't know how can I use...!!!
In this words point of this:
 "The projection matrix is implicitly created by the engine based on the current fov settings and the far and near clipping plane."
How can I use of "Fov" for solve that.
In this link say good thing about this but I really don't understand about that:
http://paulbourke.net/miscellaneous/lens/
Thanks

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11775
    • View Profile
    • http://www.jpct.net
Re: Projection Matrix jpct+Vuforia
« Reply #1 on: September 21, 2015, 11:05:56 am »
What do you want to do? Setup the values for fov and the clipping planes so that it matches a given projection matrix?

Offline nima.sh23

  • byte
  • *
  • Posts: 40
    • View Profile
Re: Projection Matrix jpct+Vuforia
« Reply #2 on: September 21, 2015, 03:35:56 pm »
In simple terms,I want set Vuforia projection matrix to jpct.
on the another topic you told "The projection matrix is implicitly created by the engine based on the current fov settings and the far and near clipping plane. There's no way to set it directly from the outside.".

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11775
    • View Profile
    • http://www.jpct.net
Re: Projection Matrix jpct+Vuforia
« Reply #3 on: September 21, 2015, 03:52:19 pm »

Offline nima.sh23

  • byte
  • *
  • Posts: 40
    • View Profile
Re: Projection Matrix jpct+Vuforia
« Reply #4 on: September 23, 2015, 08:45:18 am »
Maybe my question was wrong.
In OpenGL when I want draw a 3D model I use of projection matrix(get camera calibration and use of Tool.getProjectionGL(camCalib, nearPlan, farPlan) for set near plan and far plan) but in JPCT-AE,I can't do that.
I get camera calibration and use of getProjectionGL for get projection matrix and then get array indexes  like below link for use of focal length and size in the
float fovyRadians = (float) (2 * Math.atan(0.5f * size.getData()[1] / focalLength.getData()[1]));
float fovRadians = (float) (2 * Math.atan(0.5f * size.getData()[0] / focalLength.getData()[0]));
formula,but It's wrong.
when I set fov and fovy to camera and also my pattern is very large jpct can't draw 3D model I should set a near plan and far plan on camera.
How can I do that?
Sorry for bad English

      
« Last Edit: September 23, 2015, 08:53:30 am by nima.sh23 »

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11775
    • View Profile
    • http://www.jpct.net
Re: Projection Matrix jpct+Vuforia
« Reply #5 on: September 23, 2015, 11:22:27 am »
So...you basically want to know which values to use for far and near plane then?

Offline nima.sh23

  • byte
  • *
  • Posts: 40
    • View Profile
Re: Projection Matrix jpct+Vuforia
« Reply #6 on: September 23, 2015, 02:31:51 pm »
yes, I want to know which values and where to set them.

Offline nima.sh23

  • byte
  • *
  • Posts: 40
    • View Profile
Re: Projection Matrix jpct+Vuforia
« Reply #7 on: September 23, 2015, 04:07:34 pm »
Finally I found it
world.setClippingPlanes(10.0f, 50000.0f);
Thanks a lot.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11775
    • View Profile
    • http://www.jpct.net
Re: Projection Matrix jpct+Vuforia
« Reply #8 on: September 23, 2015, 06:50:11 pm »
Oh boy...so THAT was what you were looking for? Sorry for not getting this earlier. The whole matrix thing pointed me in the wrong direction....

Offline nima.sh23

  • byte
  • *
  • Posts: 40
    • View Profile
Re: Projection Matrix jpct+Vuforia
« Reply #9 on: September 26, 2015, 08:28:37 am »
Sorry for my bad English.
Thanks for your helps.