hi all,
I have a object in the 3-D world and I am dragging it using mouse. I am able to drag the object but problem is that I am dragging it in the world coordinate system based on the mouse motion on the screen. For example, if I move the mouse in X-direction by +10 pixels, I change the world coordinates ob the object by 2.0 units in X-direction. Similar approach to other axes too. The problem is that if I change my view in 3-D world and then try to drag the object, it moves in opposite direction sometimes depending on the view. I understand that this is because the motion I am asking it to do is hard-coded in my program.
How can I make it move in the direction I want ? One solution that seems likely is to use the world-coordinate positions of the object to drag it by unprojecting and projecting back the mouse location.
Thanks.