how to pass modelviewmatrix to get proper rendering

Started by MrYogi, June 19, 2012, 09:26:51 AM

Previous topic - Next topic

MrYogi

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 

MrYogi

hey for those who faced the same problem i found the solution:

these lines done all for me in onDrawFrame:
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.