How to create 3D content precisely aligned with real scenes using Mega Studio
This document will introduce how to use Mega Studio on Unity to accurately place virtual objects at specific positions in real space, ensuring precise alignment with the real environment in AR experiences.
Before you begin
- Refer to the documentation Is my localization library ready to use? to confirm that the localization library has been correctly created and the Mega Block has been added.
- Prepare the 3D assets to be used in the Unity project.
Place 3D content precisely
By following the steps below, you can accurately place virtual content in real-world space.
Mount 3D content under the block node
After loading the block dense model, mount the 3D content under the block node in the scene as its child node.

Fine-tune model position
Adjust the position and rotation of 3D content in the scene against dense models to align them to the desired location and orientation.
[Optional] Adjust the model position precisely based on the panorama
Click the load button next to the panorama marker in the Inspector panel, and the panorama marker will appear in the scene.


Click any panorama marker to place the model in the panorama view. You can switch between different panorama markers to ensure the 3D content is accurately positioned from various perspectives.

What to do if the loaded block model is not horizontal
In the Hierarchy panel, select Block Root, and in the Inspector panel, adjust the Rotation 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 the Block, and thus does not affect the rendering results of 3D content as child nodes of the Block. Its Transform is irrelevant to the final display effect.
What to do if the loaded block model is broken
During 3D reconstruction, incomplete coverage of collection perspectives may result in broken or missing parts in the generated dense model.

For incomplete models, if the alignment accuracy of 3D content in broken/missing areas is not critical, you can place 3D content by clicking panorama markers while referencing the panoramic image. Subsequently, verify the effect by clicking different nearby panorama marker positions.

If high-precision alignment of 3D content in broken/missing areas is required, supplement or update the map via incremental update or lossless full update. Typically, such areas indicate insufficient coverage during data collection. Mega localization performance may be compromised within these regions, making mere 3D content alignment in the editor insufficient.
Next steps
- Further verify placement accuracy by simulating runs with the session verification tool.
- Add accurate environmental occlusion to the scene to enhance AR realism.