Setting up the project

Let's jump right in:

  1. Create a new 3D project in Unity, named BusinessCardART.
  2. Import the ARToolkit asset package (for example, ARUnity5-5.3.2.unitypackage) using Assets | Import Package | Custom Package....

Create the AR Controller object.

  1. Add an empty object using GameObject | Create Empty named AR Controller.
  2. Click Add Component and add ARController to it.
  3. Make sure the component script's Video Options' Layer attribute is set to AR Background (we're referring to the Video Options Layer not the object Layer at top of the Inspector). If necessary create the required layers first, see Chapter 2, Setting Up Your System, for instructions.

Create the AR Root object.

  1. Add an empty object using GameObject | Create Empty named Root.
  2. Click Add Component and add AR Origin to it.
  3. Set the object's Layer to AR Background 2 at the top of the Inspector.

Add an AR Camera.

  1. In Hierarchy, move the existing Main Camera to be a child of Root.
  2. Click Add Component and add ARCamera to it.
  3. Reset the camera's transform, using the Transform | gear icon | Reset.
  4. Set the camera's Culling Mask to AR Background 2 (select Nothing then AR Background 2 to set it).
  5. Save your work: File | Save Scene As and File | Save Project.

At this point you can test it by pressing Play and you should see the video feed in the Game pane.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset