Hi,
I want to drag an object3D , I follow the wiki about how to object it's works but when I try to move the object with the translate method, the object isn't under the mouse :(
my code :
public void mouseMoved(MouseEvent me) {
if(picked==null) return;
dest =Interact2D.reproject2D3DWS(world.getCamera(), buffer, me.getX(), me.getY());
System.out.println(dir.calcSub(dest).toString() + " " + me.getX() + " " + me.getY());
dest.z = 0;
dir.z = 0;
moveObj3D(picked, dir.calcSub(dest));
dir = dest;
}
How can I fix it ?
Thanks for your help.
Look at this (http://www.jpct.net/forum2/index.php/topic,2622.0.html), here is something similar, but object is translated by touch
Sorry the source doesn't help me :), I need to understand how to simply move a picked object and this object sticks the mouse cursor.
The object has a depth (i.e. a z-position). You have to use the reproject-variant that takes this into account.