Which i need is to move an model along the screen X-AXIS and Y-AXIS but never Z-AXIS by drag
Now I can get the model in the screen which is been touched, and i can move them by drag with this code
SimpleVector simpleVector = Interact2D.reproject2D3D(camera, frameBuffer, x, y).normalize();
if(collition != null){
SimpleVector cPosition = camera.getPosition();
int cz = (int) cPosition.z;
int a = (int) (z_plane - cz / simpleVector.z);
int xx = (int) (cPosition.x + a * simpleVector.x);
int yy = (int)(cPosition.y + a * simpleVector.y);
simpleVector = new SimpleVector(xx, yy, z_plane);
collition.clearTranslation();
collition.translate(simpleVector);
}
But it donot go well if the camera has a rotation, i think it's about the z_plane i always support it to 10
What should i do to fix this?