MotionTracking_ImageTarget

Demonstrate how to use motion tracking and image tracking together.

How to Use

../../_images/image_39.png
Mark 1: Display system status and operation hint.
Mark 2: Switch world center mode.

Cube in the scene can be moved in the scene with one finger. Two finger pinch will scale the cube, two finger vertical move will move the cube near/far and two finger horizontal move will rotate the cube.

How It Works

Use motion tracking and image tracking together

To use motion tracking and image tracking together, just put them under the same ARSession. There are many usable motion tracking features, and it is suggested to add them all, ARSession will choose the one available in runtime.

../../_images/image_s10_1.png

Objects under world root

WorldRoot is designed to do these things,

  • Control show/hide of objects when tracking status change.

  • Move together against camera according to ARSession.CenterMode.

You can ignore WorldRoot If you can make sure all above is handled by yourself.

In this sample, WorldRootController.ActiveControl is set to ActiveControlStrategy.HideWhenNotTracking, so the cube will hide when tracking fails.

../../_images/image_s10_2.png

Center mode

In ARSession.ARCenterMode.SessionOrigin the camera will move automatically when the device moves, and the WorldRoot stay. In ARSession.ARCenterMode.Camera, the camera do not automatically move when the device moves. For other center modes, please reference Center mode.