Getting Started with Vuforia Engine and Lumin

Use the Vuforia Engine to build powerful AR experiences for the Magic Leap devices using Vuforia’s many features including; Image Targets, VuMarks, and Model Targets. Combine robust tracking of the physical environment and objects with the Lumin OS and create augmented instructions to workers and visitors, or spark joy with immersive effects for toys, cars, and appliances. Start your Vuforia and Magic Leap journey here with setting up the Vuforia Engine and the Magic Leap Lumin SDK.

For a guide on how to connect your Magic Leap device, see Magic Leap’s Connect Device documentation.

Refer to the Supported Versions page for details on the operating systems that are supported by the Vuforia SDK.

Install Vuforia Engine and Lumin for Unity

Start by installing the tools for developing with Vuforia Engine and Unity.

  1. Download a Unity Editor version supporting Magic Leap and Vuforia Engine.
    • Install Unity with the support module for Lumin OS (Magic Leap) Build Support included in the installation.

  1. Create your Magic Leap developer account if you do not yet have one.
  2. Download the Magic Leap Package Manager.
    • Follow Magic Leap’s guide to download and set up the required resources for Unity.

    NOTE: Install the latest Magic Leap Unity Package as well as the Lumin SDK.

     

Set up Vuforia Engine and Lumin SDK in the Unity Editor

  1. In an empty Unity project, Add Vuforia Engine.
  2. Go to Edit (Unity on Mac) -> Preferences -> External Tools and browse to the folder location where you have installed the Magic Leap Lumin SDK. It is usually found at /Users/<User-folder /MagicLeap/tools/unity/Vx.xx.x

  1. Navigate to Build Settings and press the Switch Platform button to change to Lumin.
    1. While in the Build Settings window, select the Player Settings and go to the expandable menu Other Settings and ensure that API Compatibility Level is set to .NET 4.x.
  2. Next, download the latest Magic Leap XR Plug-in package available in Window -> Package Manager

  1. Go to Edit -> Project Settings -> XR Plug-in Management and in the tab with the Lumin icon, check the box for Magic Leap for the Plug-in Providers.

At this point, your project is ready for the preconfigured Magic Leap Vuforia Sample. Head over to Working with the Vuforia Magic Leap Sample in Unity to get started.

For a custom set up, continue with the steps below.

  1. Import the Magic Leap Unity Package by navigating to Assets -> Import Asset -> Custom Package.
  1. Select the Magic Leap Unity Package. The packages can be found in the directory: [User]/Magic Leap/Tools/Unity/Vx.xx.x

NOTE: if you receive an “API update required” notification, go ahead and press ‘I made a Backup, go ahead!'.

  1. Return to the Project Settings’ Player configuration panel.
  2. Go to Publishing Settings to sign your Magic Leap application.
    1. Check the box for sign package and add your Magic Leap certificate. See Get a Developer Certificate if you do not yet own one.

Unity has now set up with the Lumin SDK and the Vuforia Engine.

Adding Vuforia Components

  1. Start by replacing the Camera GameObject with the Magic Leap Main Camera Prefab located in Assets/MagicLeap/Core/Assets/Prefabs.
  1. Proceed to add the following components to the Magic Leap Main Camera GameObject.
    • Vuforia Behaviour
    • Default Initialization Error Handler

  1. We can now add Vuforia's Image Target feature to the project. Go to GameObject -> Vuforia Engine and select Image Target. Choose the Image Target type from the inspector. See Image Targets to learn about databases, instant Image Targets, and Cloud Recognition. Selecting Database lets you import a default Vuforia Image Target Database.
  2. Add a Cube GameObject as a child to the ImageTarget GameObject
    • You can use Unity's hand, move, rotate, and scale tool to align the cube on top of Image Target.

Manifest settings

  1. In Edit -> Project Settings go to MagicLeap -> Manifest Settings and change the minimum API level to level 7. 
  2. Add the following privileges in the expandable menus Autogranted, Sensitive, and Reality.
    • Autogranted
    • Internet
    • LowLatencyLightwear
    • PcfRead
    • Sensitive
    • LocalAreaNetwork
    • Reality
    • CameraCapture
    • ComputerVision

  1. Save the project and Save the scene.
  2. Go to File-> Build and Run. This should compile and install the .MPK file on your ML device given that it is connected. A new window will ask whether to allow the application to access camera etc. Grant all permissions and look at the Image Target, in this case, the default database’s astronaut image.

You can print the ImageTarget for testing from Assets/Editor/Vuforia/ForPrint/ImageTargets/target_images_USLetter.pdf

Setting up Vuforia Engine and Lumin for Native

For developing AR experiences using the Vuforia Engine native C API, first download the Vuforia SDK for Lumin. This package provides the Vuforia Engine library (.so) and C header files for native development.

  1. Set up your Visual Studio project following Magic Leap’s setup guide.
  2. Add the Vuforia SDK package to the project. The package consists of a shared library and header files.
    • Add the header files to your include paths in the project.
    • Link to the shared library and include it in the build package (.mpk) via the .package file.