SpatialMap_Sparse_AllInOne¶
Attention
The content of this page will be updated soon.
Note
This sample supports AR Foundation (it can also work without AR Foundation). If you want to use AR Foundation, please refer to AR Foundation Configuration for configuration.
Demonstrate how to use sparse SpatialMap.
Demonstrate how to create sparse SpatialMap
Demonstrate how to put virtual objects onto SpatialMap
Demonstrate how to preview persistence contents
Demonstrate how to localize multiple maps and show contents on them
Reference: Motion Tracking and EasyAR Features.
Configurations¶
Server access information is required when using sparse spatial map, which can be get from SpatialMap page in EasyAR develop center. There are two ways to set this information in Unity.
One is global configuration, EasyAR Settings Spatial Map > Service Access [Global],
Another is local configuration in the scene, it is only valid to the current scene.
SampleOneShotRendererFeature should be added to Renderer Data if URP is in use.
How to Use¶
Main view¶
Click the black part of the view can collapse and expand the map list.
The map list is empty at beginning and filled with maps after create.
Select one map from the list, then click Edit to put 3D content and click Preview to preview the contents.
Select multiple maps from the list, only preview can be clicked, and this sample will detect and track all maps.
Create view¶
Edit view¶
Templet icon can be dragged into the scene. If there is a map localized, drag the icon on the point cloud will generate an object in 3D scene. You can drag it multiple times and multiple objects will be created.
Contents of the preset four buttons are cube, namecard image, red packet model and video.
Preview view¶