google-ar / WebARonARCore

An experimental Chromium modification in the form of an app for Android that lets developers build Augmented Reality (AR) experiences using web technologies on top of Google's ARCore.
https://developers.google.com/ar/develop/web/getting-started
Apache License 2.0
756 stars 115 forks source link

Moving objects by dragging rather than 'teleporting' them #58

Closed robertjuh closed 6 years ago

robertjuh commented 6 years ago

Hello,

Would it be possible to move objects over a plane with a drag motion? This instead of the process of tapping on a place in the plane and the object will teleport or clone there?

If it's not made yet, i could give it a try to make it myself but i'm not sure where to start maybe you have suggestions?

msimpson commented 6 years ago

You could listen to planesadded, planesupdated, and planesremoved to create, update, and remove surface extents to which you could clamp the Y axis of your game objects. Those events are emitted by the ARDisplay, which is returned by the promise generated from the getARDisplay method of THREE.ARUtils.

I did something similar when I layered ammo.js over the scene with surfaces tessellated as a ground objects with which other game objects would collide. Some of my initial questioning and code can be found in this issue on the THREE AR repository.

judax commented 6 years ago

I think this question fits better in the three.ar.js repo. I would suggest/encourage you to re-post it there. Happy to reply once you do with some suggestions.