Log in or register to post comments

Ground plane + Lean Touch

February 9, 2018 - 6:30am #1

Good day to all of you!

We would like to create an AR sample app using the Vuforia Ground Plane feature. We specialize in Archviz but we use UE4 for our daily driver, so my knowledge of Unity and C# is fairly limited.

Firstly, I have managed to successfuly go through the Ground Plane tutorial and deployed an Android app where I can place our 3D object in the detected space. I have also replaced the Content Positioning Behaviour script with the Deploy Stage Once script in order for the object to be spawned in only one location and in only one instance.

This is where I am now. But the final app should contain the following functionalities:

1) Spawn the 3D object automatically without tapping the screen (or possibly create a UI button that will spawn it?) or disable the respawn on the 2nd tap of the screen;

2) Add scale functionality using 2 finger gestures; (Lean Touch)

3) Add rotate functionality in only 1 axis using 2 finger gestures; (Lean Touch)

The main issue I am encountering happens after I add the Scale and Roate scripts into the 3D object (child of the Ground plane stage). Because both the 3D object spawning and the functionalities rely on touch input, once I open the app on a Galaxy S8+ and register the first tap of the screen, nothing happens. In this example at 5:40 sec into the video (https://www.youtube.com/watch?v=EUxiW_7W8rw&t=55s) the person talks about adding a UI button which can stop the ground detection feature and he reffers to the ARkit example script called "HitTest". Is there a similar procedure / example script for Vuforia?

I have found an example on this forum explaining how to disable the stage redeployement after the first tap (https://developer.vuforia.com/forum/ground-plane/there-way-disable-stage-redeployment-after-first-click), but after editing the DeployStageOnce script and assigning the SetActive Plane finder to "false", nothing happens. I build the app and it does not even register the first tap anymore in order to spawn the object. Even if the Lean Touch scripts are not added yet. Prehaps I don't need to edit the script and there is an option built-in the Unity interface?

It makes sense to me that once you stop the Ground Plane from registering the input, you can freely use the Lean Touch functionalities without taking the 3D object out of the screen. BUT, having that you initially need to tap the screen one time in order to place the object I was thinking to proably make it so that the 3D object spawns automatically once you are in the app? This, or make it so that Lean Touch inputs can only be registered after the ground detection feature is disabled? I have found many examples regarding Vuforia + Lean Touch, but most of them focus on the Image Target feature :( What are your thoughts?

Some other small issues include not being able to walk around and behind the 3D object once it is spawned. The object moves/shakes slightly on the screen when I move the phone and dissappears at one point before ending up behind it. And I cannot add another object on the plane afterwards, I need to restart the app in order to do so.

In the same ARkit example at 2:02 sec (https://www.youtube.com/watch?v=EUxiW_7W8rw&t=55s) he talks about adding a ShadowPlanePrefab under the HitCubeParent. Is there a similar procedure / example for Vuforia?

I apologize for the long post :) I am aware that I am missing some of the fundamentals required when developing in this environment, so feel free to post any links to tutorials/videos/basics that you think are needed for my case. I am sure plenty of you have hit a smiliar "wall" during your development,  so your expertise is invaluable.

-Andrei

Ground plane + Lean Touch

August 23, 2018 - 1:51pm #8

I discovered today that vuforia samples now (since march!) includes a rotate and scale controls as part of the groundplane demo on the unity app store.

a shame as I implemented lean touch last week!

Ground plane + Lean Touch

August 23, 2018 - 11:16am #7

I did the same thing and it worked, after the first touch the plane finder is disabled. But lean touch does not work. Can you help me?

Ground plane + Lean Touch

March 13, 2018 - 11:37am #6

Borer1 wrote:

For 1) you can add the Method in "On Automatic Hit Test"-List. This will activate the Method as soon as the app finds a Plane, which is normally at startup if there is a Plane to be found.

 

For 2) just call "gameObject.SetActive(false);" in the method for placing the Object.

 

I'm not sure though if the Touch will work, but the Plane Finder is deactivated as soon as the object is placed. I used the "DeployStageOnce" script from the tutorial with some minor adjustments.

 

Thank you for your script. It worked for me and I can use Lean Touch now when I place an object. Here's my new problem. I added a reset button to allow me to re-place the object, but unfortunately, all my button does is destroy the previous anchor and it doesn't take me back to the beginning of being able to re-place my object. Would you happen to have a solution for that as well? I feel like I'm almost there, but this one little feature of being able to use Lean Touch and also give the user a chance to re-place the object in another location is driving me up the wall.

Ground plane + Lean Touch

March 7, 2018 - 2:14am #5

For 1) you can add the Method in "On Automatic Hit Test"-List. This will activate the Method as soon as the app finds a Plane, which is normally at startup if there is a Plane to be found.

 

For 2) just call "gameObject.SetActive(false);" in the method for placing the Object.

 

I'm not sure though if the Touch will work, but the Plane Finder is deactivated as soon as the object is placed. I used the "DeployStageOnce" script from the tutorial with some minor adjustments.

AttachmentSize
Plain text icon DeployStageOnce.txt1.67 KB

Ground plane + Lean Touch

March 5, 2018 - 5:50am #4

I am having the same problem now. 

For 1). I was thinking about make a fake touch to the screen and I found a way to do it.

Ground plane + Lean Touch

February 10, 2018 - 12:44pm #3

I think this is what I am essentially looking for as well.  

Ground plane + Lean Touch

February 9, 2018 - 9:13am #2

TL DR: Cannot get Lean Touch to work with Ground Plane because of touch input conflicts. 

1) Is it possible to make the 3D object spawn automatically when the app initializes?

2) Or add UI button which can stop the Ground Plane feature and allow Lean Touch to register? Already tried SetActive plane finder to "false" in the DeployStageOnce script and it does not even spawn the inital object anymore.

3)  Possibly make Lean Touch register inputs only after the Ground Plane feature is disabled (via UI)?

 

Many thanks

-Andrei

Log in or register to post comments