Table of Contents

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

Although xr-frame doesn't provide 3D editing capabilities, you can use Mega Studio to place virtual objects accurately in real-world positions, ensuring precise alignment with 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 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 the model's Position and Rotation to 0 ensures the model's geometric center perfectly coincides with the annotation point. All displacement and rotation adjustments should be done by manipulating its parent node (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 be 0, otherwise you won't get correct rendering results in xr-frame.

[Optional] Precise model positioning using panorama images

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 position the model at that location. You can switch between panorama positions to verify the model's placement is accurate from different viewpoints.

Panorama editing

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.

Block Root's Transform in the world coordinate system does not affect the Block's local coordinate system, and thus does not affect the rendering results of annotations and their child models. 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, incomplete coverage of collection angles may result in fragmented or missing sections in the dense model.

Fragmentation and missing parts

For incomplete models where alignment precision in fragmented/missing areas isn't critical, position 3D content by clicking panorama markers and referencing panoramic images. Verify the effect by clicking different nearby panorama marker positions.

Positioning via panorama images

Obtain the placement result.

Placement result

If high alignment precision is required in fragmented/missing areas, perform map supplementation or updates via incremental updates or lossless full updates. Typically, such areas indicate insufficient coverage during data collection. Mega's localization effectiveness may be compromised within these regions, making mere 3D content alignment in the editor insufficient.

Next steps

WeChat Mini Program Mega Plugin:

Mega Studio: