How to create precisely aligned 3D content with 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 spaces, ensuring precise alignment with the physical environment in AR experiences.
Before you begin
Be able to use Mega Studio in Unity.
Prepare the model: Use the model from the sample project (an adorable panda), or use the little robot model from the xr-frame official demo, or refer to XRFame loadable GLTF format and supported extensions to prepare a model file that meets xr-frame requirements.
Import the model file into Unity.
Tip
The Mega plugin has already added a dependency on com.unity.cloud.gltfast, so you can directly drag the model file into Unity Assets.
Add 3D content as a child node of the annotation
Drag the imported model into the scene node as a child node of the annotation.
Set the Position and Rotation of the model in the Inspector panel to 0, and adjust the Scale as needed.
Note
EMA handles all coordinate transformation logic. Setting the model's Position and Rotation to 0 ensures that the geometric center of the model aligns perfectly with the annotation point. All displacement and rotation adjustments should be done by manipulating its parent node (the annotation node).

Adjust model position precisely
Select Annotation Node to adjust the position and rotation of the dense model in the scene.
Note
The model's Position and Rotation relative to the annotation must always be 0, otherwise you will not get the correct rendering result on xr-frame.
[Optional] Adjust model position precisely based on panorama
Click the load button on the right side of 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 panorama positions to ensure the model's placement is accurate from different perspectives.

What to do if the loaded block model is not level
Select Block Root in the Hierarchy panel, and adjust the 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 node tree.
The Transform of Block Root in the world coordinate system does not affect the local coordinate system of the Block, and therefore does not affect the rendering results of annotations and models under annotations. Its Transform is irrelevant to the final display effect.
What to do if the loaded block model has broken or missing parts
During the 3D reconstruction process, incomplete dense models may be generated due to insufficient coverage of the captured viewpoints.

When dealing with an incomplete model, if the alignment accuracy of the 3D content in the broken/missing parts is not critical, you can place the 3D content by clicking panoramic markers and referencing the panoramic images. You can then verify the effect by clicking different panoramic marker positions nearby.

The placement result is obtained.

If the alignment accuracy of the 3D content in the broken/missing parts is highly critical, you need to supplement or update the map through incremental updates or lossless full updates. Generally, such areas indicate insufficient coverage during the capture process, and Mega's localization performance may be affected within these regions. Simply aligning 3D content in the editor is not sufficient.
Next steps
Related topics
WeChat Mini Program Mega Plugin:
Mega Studio: