# MR Spatial Sync

The **Spatial Sync** add-on for SimLab Composer allows you to perfectly align your virtual 3D environment with your real-world physical space. This is essential for **Mixed Reality (MR)** experiences, where virtual objects (like a new kitchen layout) need to sit accurately within your actual room.

---

### Prerequisites

Before launching the add-on, you must organize your scene:

> \[!IMPORTANT\]
> 
> Naming Convention: All objects that you want to appear in Mixed Reality must be placed inside a single group named interior (written in all lowercase).

---

### 1. The Setup Wizard

Open the **Add-ons** menu, navigate to the **MR tab**, and launch **Spatial Sync**. The wizard will guide you through these steps:

1. **Select Group:** Choose the `interior` group you created.
2. **Corner Alignment:** A yellow sphere will appear at the scene center. Shift your 3D model so that one of its room corners aligns with this sphere.
3. **Avatar Placement:** Position the avatar at a natural starting point, such as the room's entrance.
4. **Rotation Guide:** Rotate the provided group until the **two green planes** line up with the edges/walls of your virtual room. These serve as visual markers for the user in VR.
5. **Filter Non-MR Objects:** Select any objects that should **not** be visible in Mixed Reality (e.g., placeholder walls, structural guides, or background environments) and click Next.

---

### 2. Real-World Alignment (In VR/MR)

Once you launch the experience on your headset in Mixed Reality mode, follow these steps to sync the scene:

- **Positioning:** Grab the virtual sphere and place it at the **exact physical corner** of your real room that you selected during setup. Press the **Grip** button to set it.
- **Rotating:** A rotation ring will appear. Grab and rotate it until the **green planes** on your screen perfectly overlap with your **real physical walls**.
- **Finalizing:** Press **Apply** to bring the interior objects into view. If the alignment looks correct, click **Confirm** to save the position.

---

### Summary Table: Alignment Tools

<table data-path-to-node="16" id="bkmrk-tool-action-in-vr-pu"><thead><tr><td>**Tool**</td><td>**Action in VR**</td><td>**Purpose**</td></tr></thead><tbody><tr><td><span data-path-to-node="16,1,0,0">**Yellow Sphere**</span></td><td><span data-path-to-node="16,1,1,0">Grab &amp; Place at corner</span></td><td><span data-path-to-node="16,1,2,0">Sets the "Anchor Point" for the room.</span></td></tr><tr><td><span data-path-to-node="16,2,0,0">**Rotation Ring**</span></td><td><span data-path-to-node="16,2,1,0">Grab &amp; Spin</span></td><td><span data-path-to-node="16,2,2,0">Matches virtual orientation to real walls.</span></td></tr><tr><td><span data-path-to-node="16,3,0,0">**Green Planes**</span></td><td><span data-path-to-node="16,3,1,0">Visual Overlay</span></td><td><span data-path-to-node="16,3,2,0">Acts as a guide to ensure 90° alignment.</span></td></tr><tr><td><span data-path-to-node="16,4,0,0">**Confirm Button**</span></td><td><span data-path-to-node="16,4,1,0">Click to Save</span></td><td><span data-path-to-node="16,4,2,0">Permanently locks the virtual scene to your room.</span></td></tr></tbody></table>

---

### Why use Spatial Sync?

- **Precision:** Ensures virtual furniture or renovations are viewed at the correct scale and position.
- **Ease of Use:** Replaces complex manual coding with a simple "grab-and-place" mechanic.
- **Persistence:** Once confirmed, the virtual interior stays locked to the real world, allowing for a stable walkthrough.

Watch this tutorial to learn more

<iframe allowfullscreen="allowfullscreen" height="314" src="https://www.youtube.com/embed/s_Wq9Dm054k" width="560"></iframe>