google-ar / sceneform-android-sdk

Sceneform SDK for Android
https://developers.google.com/sceneform/develop/
Apache License 2.0
1.23k stars 604 forks source link

Is there a means to consider a detected ARPlane as infinite ? #764

Open Mavhrin opened 5 years ago

Mavhrin commented 5 years ago

Hi everyone,

I use the ARCore TransformableNode/TransformationSystem which proposes already implemented gestures and controllers to move the objects in the scene but the movements are constrained by the shapes of the detected planes. I wonder if there is a way to set a particular detected plane as infinite in order to move an object everywhere on it without implementing my own gestures, controllers and picking system.

I saw the notion of infinite plane exists in ARCore for Unity : https://developers.google.com/ar/reference/unity/namespace/GoogleARCore#namespaceGoogleARCore_1a8da5a2395bdef6ffe411700df5a713ff

Thanks for your help.

tonilsz commented 5 years ago

Hi,

Isn't this duplicated?

At the moment you can't do that directly, but you can copy Translation controller and you only have to remove one line.

Take a look here: https://github.com/google-ar/sceneform-android-sdk/issues/363

Hope that will help you.

Mavhrin commented 5 years ago

Hi tonilsz,

Thanks for you answer. I guess I will do something like that even if it's quite annoying to write new code when the existing behavior is fine except for one case. I cannot just remove the line of code you mentioned as I want only one infinite plane among all those detected but I know where to look for.

georgevaranosPM commented 4 years ago

Hey,

What you can do is to transform the position of the anchor node (in Vector3 data type) on which your object is attached. By transforming the position of the anchor node programmatically, ARCore doesn't constraint you at all, so theoretically there is an infinite plane to play with. Take a look at an example code of mine:

anchorNode.setLocalPosition(new Vector3(99, 99, 99));