ObjectTracking

Attention

The content of this page will be updated soon.

Demonstrate how to track 3D objects.

How to Use

../../_images/image_32.png
Mark 1: Whether open the camera.
Mark 2: Switch camera using device index.
Mark 3: Switch horizontal flip mode of the camera image rendering.
Mark 4: Switch world center mode.
Mark 5: Unload/load all image targets in the scene.
Mark 6: Stop/start tracking.

The object could be tracked is the same target in the scene. Find model texture image in the project, print out and make a hexagon from it.

How It Works

Targets in the scene

If you want to replace the model in the sample to your own, make sure to choose a .obj file with rich texture, and fill in Extra File Paths with all .mtl and .jpg/.png paths referenced in .obj and .mtl files. It is also suggested to read EasyAR 3D Object Tracking to help choosing a trackable object.

../../_images/image_s4_1.png

Target can be setup directly from the inspector of Unity editor.

  • Source: Targets are created from Obj File in this sample.

  • Path Type: StreamingAssets here, so that all the Path will use a path relative to StreamingAssets.

  • Obj Path: .obj file path relative to StreamingAssets in this sample.

  • Extra File Paths: .mtl and .jpg file path relative to StreamingAssets in this sample.

  • Name: Name of the target, choose a world easy to remember.

  • Scale: It is set according to physical size of the hexagon foldered using A4 size paper in real world.

  • Tracker: The Tracker to load ObjectTarget.

Gizmo is displayed after load if not disabled in the global settings when the target setting is valid. This will not show in the game view.

The transform of the hexagon has been adjusted so that it will be aligned with the target. When you run this scene and track the target, the hexagon will show and cover the target.