R
R
raw12017-06-21 10:46:14
Programming
raw1, 2017-06-21 10:46:14

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

3 answer(s)
G
GreatRash, 2017-06-21
@GreatRash

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.

D
Denis Gaydak, 2017-06-21
@MrMureno

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)

A
Alexander Skusnov, 2017-06-21
@AlexSku

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 question

Ask a Question

731 491 924 answers to any question