How do i translate movement on the Canvas3D to movement in the virtual 3D world
- by Coder
My goal is to move a shape in the virtual world in such a way so that it ends up where the mouse pointer is on the canvas.
What i have:
-mouse position (x,y) on a Canvas3D object
-Point3d object of where a pick ray starting from the Canvas3D viewport intersects with the first scene object. (point in 3D space of where i want to start the drag)
What i want:
-Some way to translate the Point3d's coordinates so that the initial point of intersection (the Point3d object) is always overlapping the the mouse position on the canvas (same as when i used the pick ray to determine what the user clicked on from the Canvas3D object).
Thanks!