Adding objects

We now can add the drone to the project. First import the model into the project:

  1. Import the SimpleDrone package using Assets | Import Package | Custom Package....
  2. Now we add the drone into the scene. Make it a child of the PurpleFinch Target target object.
  3. Drag the SimpleDrone prefab into the Hierarchy, and make it a child of PurpleFinch Target.
  4. Select the drone and set the scene gizmo to Scale, or enter the Transform Scale to (0.001, 0.001, 0.001) and move it resting on the center of the card, Position (0.01, 0.005, 0).

Scaling in ARToolkit is a bit different than Vuforia. In Vuforia we could set the target size in real-world units, thus the business card is scaled to 0.09.

By default, ARToolkit assumes the target is vertical, as if it's hanging on a wall. Vuforia defaults with the target laying flat, like it's on a table. To lay our target flat and keep the drone upright:

  1. Set the Root's Transform X Rotation to 90 degrees.
  2. Set the SimpleDrone's Transform X Rotation to -90 degrees.
  3. One last thing, double-check that the objects under Root are all on the AR background 2 layer. Select Root and in Inspector set its layer again, Unity will prompt you to change all its children's layers also. Do it.

The resulting Scene view for ARToolkit version of our project should now look similar to this:

You should also add the animations to make the drone fly. We won't repeat the details here, please refer to the previous section.

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

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