Table of Contents

How to place 3d content using mega studio on unity

This document will guide you through quickly learning how to use annotation tools for model placement in the Unity editor, preparing for subsequent rendering on xr-frame.

Before you begin

Prepare gltf model and drag into unity assets

You can use the model from the sample project (an adorable panda), or use the small robot model from the official xr-frame Demo, or prepare your own model by referring to xr-frame loadable gltf formats and supported extensions and upload it to a resource hosting server.

Tip

The Mega plugin has added dependency on com.unity.cloud.gltfast, so you can directly drag model files into Unity Assets.

Drag model into unity assets

Select mega cloud localization library

Click the icon to the right of Mega Cloud Service.

Studio tool

Select the library to use.

Select library

After successfully loading the localization library and Mega Blocks information, the Studio tool panel appears as shown.

Loaded studio tool

Load block dense mesh

Click Load to the right of the Block name to dynamically load the dense mesh for that Block.

Click block load

Create annotation

Hold down the Ctrl (Windows) / Command (Mac) key in the scene, then left-click on the ground where you want to annotate.

Create annotation

Add 3d content as child node of annotation

Drag the imported model onto the scene node as a child node of the annotation.

Drag model into scene

Set all Position and Rotation values in the model's Inspector panel to 0. Scale can be adjusted as needed.

Note

EMA handles all coordinate transformation logic. Setting model Position and Rotation to 0 ensures the model's geometric center perfectly aligns with the annotation point. All displacement and rotation adjustments should be done by manipulating its parent node (annotation node).

Modify model transform

[Optional] adjust model position

Select the annotation node and adjust the model's position and rotation in the scene relative to the dense mesh.

Note

The model's Position and Rotation relative to the annotation must always be 0, otherwise you won't get correct rendering results on xr-frame.

Modify annotation node transform

Create new annotation data package

Click the icon to the right of the annotation data package in the Inspector panel.

Add annotation data

Enter the annotation data name in the box and click the checkmark on the right.

Enter annotation data name

After successful creation, it should appear as shown. Then click Confirm below.

Confirm annotation creation

Click the upload icon to upload.

Upload annotation

A success prompt appears after upload.

Success prompt

Confirm annotation data

You need to record the ID of the annotation data to load the corresponding annotation data on xr-frame.

Annotation data panel

After successful upload, you can also see corresponding information in the cloud localization library. The ID in this page's list is the annotation data package ID.

Annotation information in cloud localization library

Here you can also view the uploaded annotation data name and ID. The ID in this page's list is the annotation point ID.

Annotation data name in cloud localization library

Next steps