google-ar / arcore-android-sdk

ARCore SDK for Android Studio
https://developers.google.com/ar
Other
4.97k stars 1.22k forks source link

Feature Request: Sample code demonstrating drag-n-drop object placement #318

Open RavindraVirat opened 6 years ago

RavindraVirat commented 6 years ago

I want to implement the functionality to move around the anchor object like "Drag n Drop", using onTouchEvent method I am getting the touch co-ordinates but I am not getting how to apply this co-ordinates to anchor so that it will appear like it is moving, please guide me with the Sample code.

inio commented 6 years ago

This is not currently covered in our sample code. There's a couple options:

  1. Use the hitTest result pose each frame without creating an anchor
  2. Each frame during the drag create a new anchor and detach the old one
  3. Create an anchor when the drag starts, store the relative hit pose each frame during the drag, and then create a new anchor when the drag completes.
ChanduMnS commented 5 years ago

What is the event that is triggered when drag and drop occured? https://github.com/inio @

This is not currently covered in our sample code. There's a couple options:

  1. Use the hitTest result pose each frame without creating an anchor
  2. Each frame during the drag create a new anchor and detach the old one
  3. Create an anchor when the drag starts, store the relative hit pose each frame during the drag, and then create a new anchor when the drag completes.

What is the event triggered when drag and drop. @nvictornvictor