Using user-defined targets
Unlike pre-existing images or encoded targets, user-defined targets are images captured at runtime that the software will recognize and use as the trigger for rendering virtual AR content.
As we prepare to begin working in 3D, change the Scene
view from 2D to 3D.
In the Scene
window, uncheck 2D
in its icon toolbar, because we want to start working in 3D now, as shown in the following screenshot:
Adding a user-defined target builder
Let's add the UserDefinedTargetBuilder
to our project now:
- Drag the
UserDefinedTargetBuilder
prefab from theVuforia/Prefabs/
folder intoHierarchy
. - Check
Start Scanning Automatically
.
For now, we are telling the target builder to start scanning automatically. This is useful at this point in our development.
But really, we want to control the scanning to occur only while in AR mode. We can add this to the InstructionsController
script as follows:
File: InstructionsController.cs public UserDefinedTargetBuildingBehaviour UserDefinedTargetBuilder...