Thank you for answer!
If I do how you wrote above, my object is moving on a pixel because of cube.clearTranslation();
Now I do so:
..........
if (me.getAction() == MotionEvent.ACTION_UP) {
x=me.getX();
y=me.getY();
trans = new SimpleVector(Interact2D.reproject2D3DWS(world.getCamera(), fb, (int)x,(int) y));
pos = world.getCamera().getPosition();
float Z_PLANE=0;
float a = (Z_PLANE - pos.z) / trans.z;
float xn = pos.x + a * trans.x;
float yn = pos.y + a * trans.y;
moveVector = new SimpleVector(xn,yn,Z_PLANE);
return true;
}
..........
if (moveVector!=null){
сube.translate(moveVector.normalize());
}
But my object is moving properly. Help me please!
If I do how you wrote above, my object is moving on a pixel because of cube.clearTranslation();
Now I do so:
..........
if (me.getAction() == MotionEvent.ACTION_UP) {
x=me.getX();
y=me.getY();
trans = new SimpleVector(Interact2D.reproject2D3DWS(world.getCamera(), fb, (int)x,(int) y));
pos = world.getCamera().getPosition();
float Z_PLANE=0;
float a = (Z_PLANE - pos.z) / trans.z;
float xn = pos.x + a * trans.x;
float yn = pos.y + a * trans.y;
moveVector = new SimpleVector(xn,yn,Z_PLANE);
return true;
}
..........
if (moveVector!=null){
сube.translate(moveVector.normalize());
}
But my object is moving properly. Help me please!