EasyAR4.0 Simple Instructions

Keywords: SDK

EasyAR4.0 was launched late last year with new features such as motion tracking and sparse cloud maps.

Registration, Basic Settings

EasyAR requires user registration, flat image tracking, object tracking, and surface tracking by adding a Sense License Key.If you need to use sparse cloud maps, you also need to add "API KEY"

Sense License Key is bound to the Package Name/Bundle ID of the application.

After importing the EasyAR SDK, enter the key by clicking the Settings file under the menu [EasyAR--Change License Key] or directory [EasyAR/Resources/EasyAR].

overall structure

EasyAR officially makes many things into prefabricated parts, which in most cases can be used directly.

[EasyAR] and [RenderCamera] are required content, matching [VideoCameraDevice] and [VIOCameraDevice] according to type.

Official Note

Camera needs to be set to a monochrome black background. Sky box cannot be used

Planar Image Tracking

In planar image tracking, each image being tracked corresponds to an ImageTarget, which needs to be specified.The number of simultaneous displays is determined by the Simultaneous Target Number.Both target and tracker can be multiple.

For program control, [ImageTargetController] has a corresponding event, and the official example [ImageTracking_Targets] has a reference.

        private void AddTargetControllerEvents(ImageTargetController controller)
        {
            if (!controller)
            {
                return;
            }

            controller.TargetFound += () =>
            {
                Debug.LogFormat("Found target {{id = {0}, name = {1}}}", controller.Target.runtimeID(), controller.Target.name());
            };
            controller.TargetLost += () =>
            {
                Debug.LogFormat("Lost target {{id = {0}, name = {1}}}", controller.Target.runtimeID(), controller.Target.name());
            };
            controller.TargetLoad += (Target target, bool status) =>
            {
                imageTargetControllers[controller] = status ? true : imageTargetControllers[controller];
                Debug.LogFormat("Load target {{id = {0}, name = {1}, size = {2}}} into {3} => {4}", target.runtimeID(), target.name(), controller.Size, controller.Tracker.name, status);
            };
            controller.TargetUnload += (Target target, bool status) =>
            {
                imageTargetControllers[controller] = status ? false : imageTargetControllers[controller];
                Debug.LogFormat("Unload target {{id = {0}, name = {1}}} => {2}", target.runtimeID(), target.name(), status);
            };
        }

3D Object Tracking

3D object tracking is basically the same as flat image tracking, except that the file settings are different when tracing.Events are processed by the program under ObjectTargetController.

Surface Tracking

Surface tracking is a second-best option when the device does not support motion tracking and is not recommended.

After booting up, [WorldRoot] game objects will be fixed at the current device position and the camera will move by reference.

Motion tracking

Motion tracking has requirements for devices, see: Motion Tracking Supported Devices

Motion tracking is the basis for sparse and dense cloud maps.

Motion tracking is also the same, after booting, [WorldRoot] will be fixed in the boot position, and the camera will change according to the movement.

Sparse Cloud Map

Sparse cloud maps require motion tracking first.

Use MapWorker to control the Map.

Official Note: In the official example, UntilSuccess was used to create the map and KeepUpdate was used to load the map

When [Source Type] is [Map Builder], a map is created.The Map Manager loads the map.

The official ways to create and load maps are in the example [MapSession.cs].

Save by

MapWorker.BuilderMapController.Host(name, preview);

Where preview is a thumbnail and can be empty.name can also pick up empty strings.Returns the result through the MapHost event.

            MapWorker.BuilderMapController.MapHost += (map, isSuccessful, error) =>
            {
                ...
            };
            try
            {
                MapWorker.BuilderMapController.Host(name, preview);
            }
            catch (Exception e)
            {
                ...
            }

The Map Load Mode event is slightly more multipoint, once the ID and name of the map have been set, the MapLoad event is set to get the results, and the MapLocalized and MapStopLocalize events are mainly used to get the status.

    controller.MapManagerSource = meta.Map;
    ...
    controller.MapLoad += (map, status, error) =>
    {
        ...
    };

    controller.MapLocalized += () =>
    {
        ...
    };
    controller.MapStopLocalize += () =>
    {
        ...
    };

    MapWorker.Localizer.startLocalization();

EasyAR4.0 Simple Instructions for Use

 

165 original articles published, 152 praised, 960,000 visits+
His message board follow

Posted by Black Rider on Thu, 20 Feb 2020 18:26:55 -0800