views:

147

answers:

0

I have a 3D scene in which i have objects i can interact with using the mouse. I use a pick ray and can correctly obtain the desired object (from the PickInfo object). The problem i am facing, is that i want to drag the object or distort it along the plane of the viewport and have it be positioned where my mouse actually is in the viewport. The behaviour i am getting is that i can alter the object appropriately and move it in the direction of the mouse, but i have to move my mouse like 3 times farther that the object actually gets moved.

To be more precise, i click on an object in my scene and get back a point of where the mouse intersected with the object. I now want to keep one of the coordinates fixed, and want to get a vector of distortion which i can use to move/distort the model, but i want the vector to move/distort the shape to where my mouse appears on the Canvas3D.

I figure all i need is some code to convert to and from different coordinate spaces.