Table of Contents

How to create 3D content precisely aligned with the real world using Mega Studio on Unity

Although xr-frame does not provide 3D editing capabilities, you can use Mega Studio to accurately place virtual objects in real-world locations, ensuring precise alignment with the physical space in AR experiences.

Before you begin

Tip

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

Adding 3D content as child nodes of annotations

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

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

Note

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

Modify model transform

Precise adjustment of model position

Select the annotation node and adjust the model's position and rotation in the scene against the dense model.

Note

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

[Optional] Precise model position adjustment based on panoramas

Click the load button to the right of the panorama marker in the Inspector panel to display panorama markers in the scene.

Load panorama markers

Display panorama markers

Click any panorama marker to place the model at that location in panorama view. You can switch between panorama positions to verify the model's placement accuracy from different perspectives.

Panorama editing

[Optional] Precise model position adjustment based on LCC 3D Gaussian splatting

Note

This section applies to usage scenarios where the map was created using EasyAR Mega devices. Maps created with other devices do not contain LCC 3DGS data.

If you're using the LCC 3D Gaussian splatting (EasyAR Mega LCC) feature, you can adjust the model position against the 3DGS. Refer to Loading LCC data and aligning with Mesh for using LCC data.

What to do if the loaded Block model isn't level

Select Block Root in the Hierarchy panel, then adjust Rotation in the Inspector panel until the dense model's orientation appears correct in the Unity editor.

Important

Block Root is the parent node of all Block nodes in the 3D engine scene hierarchy.

The Transform of Block Root in the world coordinate system does not affect the local coordinate system of Blocks, and therefore does not affect the rendering results of annotations and models under annotations. Its Transform is unrelated to the final display effect.

What to do if the loaded Block model has fragmented or missing parts

During 3D reconstruction, fragmented or missing parts may appear in the dense model due to insufficient coverage of collection viewpoints.

Fragmentation and missing parts

When facing incomplete models, if the alignment accuracy requirement for fragmented/missing areas isn't high, you can place 3D content by clicking panorama markers against panoramic images. You can then verify the effect by clicking different nearby panorama marker positions.

Placement via panorama

Obtain placement results.

Placement result

If high alignment accuracy is required for fragmented/missing areas, map supplementation or updates via incremental updates or lossless full updates are needed. Generally, such areas indicate insufficient coverage during mapping, and Mega positioning performance may be affected within these regions. Simply aligning 3D content in the editor is insufficient.

Next steps

WeChat Mini Program Mega Plugin:

Mega Studio: