Answer the question
In order to leave comments, you need to log in
How to implement drag and drop in space?
I'm making a 3d editor and there you need to somehow drag objects with the mouse. If it were a plane, this could be implemented without problems, but you need to somehow add depth. That is, the movements should somehow occur in 3 axes x, y, z
Answer the question
In order to leave comments, you need to log in
I imagine it like this:
1) there is an XYZ coordinate grid
2) there is a camera (through which the user sees the object)
3) we calculate the angle between the camera plane and the coordinate grid planes
5) which angle is smaller, in that plane we begin to drag the object (of course not forgetting translate screen coordinates into coordinates on that plane)
Well, make 3 arrows to the heap (as in all 3d editors) that will duplicate the XY Z axes. If you click on the arrow, then assume that we are dragging along this vector.
docs.garagegames.com/torque-3d/official/content/do...
You must have used at least some 3d editor..
Additional objects/controls.
Arrows - along the axis allow you to move.
Squares/planes - move the object in a plane (which, as you described, does not cause problems)
Display 3 views: front, top, left. Then the movement will be in two coordinates.
To capture an object, there is a beam (mouse pointer) projection method.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question