Today I started trying some things with Vuforia 7 and it's Ground Plane / Plane Finder capabilities. I did the simple example found on Vuforia website and now I am trying to create a simple app with it.
What I want to accomplish is that, when the Vuforia PlaneFinderBehaviour has detected a plane, I want to display a toolbox onto the screen where the user can select between a few primitive 3D GameObjects (Cube, Sphere, Cilinder). After selecting the desired 3D GameObject, I want it to appear onto the ground that was detected by Vuforia. Next, when walking around and Vuforia detects ground again, the same toolbox needs to appear where the user can select a different type of 3D GameObject to be placed onto the ground.
After messing around in Unity, I still haven't managed to create my own PlaneFinderBehaviour C# script with a method that needs to be triggered when Vuforia detects ground.
What I have done:
- Created a C# script that extends the
PlaneFinderBehaviourand has a method calledCustomPerformHitTestwhich just prints something into the console.
using System.Collections; using System.Collections.Generic; using UnityEngine; using Vuforia; public class CustomPlaneFinderBehaviour : PlaneFinderBehaviour { public void CustomPerformHitTest(Vector2 screenPosition) { print("CustomPlaneFinderBehaviour > CustomPerformHitTest has been triggered"); } }
- Replaced the default
PlaneFinderBehaviourof the PlaneFinder GameObject with my Custom script
Could someone send me in the right direction and explain how Vuforia's plane detection works in order for me to understand what I have done wrong.
Thanks!
