Ok, I'll try to synthetize my code and make it as clear as I can :
object part :
...
_object.strip();
_object.build();
_object.setCollisionMode(Object3D.COLLISION_CHECK_OTHERS|Object3D.COLLISION_CHECK_SELF);
_object.setCollisionOptimization(true);
I'm not sure collision optimization and CHECK_SELF are necessary but It works that way so... I keep it.
Camera matrix part :
public boolean setCameraMatrix(float[] matrix){
if (_camera != null){
_cameraPosition.set(matrix[12],matrix[13],matrix[14]);
matrix[12] = matrix[13] = matrix[14] = 0;
_cameraMatrix.setDump(matrix);
_cameraMatrix = _cameraMatrix.invert();
_camera.setBack(_cameraMat);
_camera.setPosition(_cameraPosition);
return true;
} else {
return false;
}
}
Here, I guess you could invert the matrix before calling setCameraMatrix ( and you would have to change 12/13/14 to 3/7/11) but again, it works that way... So I keep it.
Picking part :
public Object3D pick(int x,int y){
Log.d("jpctEngine", "Picking...");
SimpleVector dir=Interact2D.reproject2D3DWS(_camera, _frameBuffer, x, y).normalize();
Object[] res=_world.calcMinDistanceAndObject3D(_camera.getPosition(), dir, 10000 /*or whatever*/);
if (res[1] != null){
Log.d("Jpct-Engine","Picking réussi.");
return res[1];
}
return null;
}
In fact, the advices you gave on picking work well.
But somehow, dumping a false(maybe inverted) matrix still gives a nice graphical result and craps the picking. Seeing graphics working, I thought the matrix was OK and looked for the problem elsewhere... Matrices are very tricky...
Well, now that's fixed ^^ thanks again, I hope this comment will help !
Bye.