MotionTracking_ImageTarget¶
Demonstrate how to use motion tracking and image tracking together.
Reference: Motion Tracking and EasyAR Features.
How to Use¶
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. Please reference Motion Tracking and EasyAR Features.
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.
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.