Author Topic: how to pass modelviewmatrix to get proper rendering  (Read 2322 times)

Offline MrYogi

  • byte
  • *
  • Posts: 21
    • View Profile
how to pass modelviewmatrix to get proper rendering
« on: June 19, 2012, 09:26:51 am »
hi friends,
i am trying to attach Jpct on top of Qcar so that after image detection rendering is done by Jpct according to the matrix of Qcar.i'm somewhat successful as the model position is now responsive to the image detected on setting the matrix in cam.setBack() but still somewhat misplaced ,it's look like inverted on z-axis and shifted on x-axis , flattens or something like that.
i'm new to Jpct so it's more or less like try n error to me .
anyone have an idea that which is the best way to do this?after googling i found that someone suggested to pass matrix to rotation matrix of the object but i can't get that.
plz help me out of this,i saw many of you done similar to this.
thanks in advance 
« Last Edit: June 19, 2012, 09:46:16 am by MrYogi »

Offline MrYogi

  • byte
  • *
  • Posts: 21
    • View Profile
Re: how to pass modelviewmatrix to get proper rendering
« Reply #1 on: June 20, 2012, 09:30:58 am »
hey for those who faced the same problem i found the solution:

these lines done all for me in onDrawFrame:
Code: [Select]
com.threed.jpct.Matrix mResult = new com.threed.jpct.Matrix();
mResult.setDump(modelviewMatrix);  //modelviewMatrix i get from Qcar
// cube.setRotationMatrix(mResult);
cam.setBack(mResult);


setRotationMatrix(mResult) and cam.setBack(mResult) both works for me.