Copyright 2023, HTC Corporation. All rights reserved.
Shared Space Experience is an MR co-location example for VIVE XR Elite. It shows how to allow users to interact in the same physical and virtual space.
In this project, we demonstrate how to align the space between two VIVE XR Elites by ArUco markers.
- Hardware
- 2 VIVE XR Elites
- System version: 1.0.999.334 or newer
- 4 VIVE Controllers for XR Series (2 per VIVE XR Elite)
- An ArUco Marker (dictionary: 4x4, ID: 0~99)
- 2 VIVE XR Elites
- Software
- Unity Editor 2020.3.36f1 or newer
- Unity Packages:
- VIVE Wave XR Plugin 5.3.1-r.2 or newer
- Unity Input System 1.3.0 or newer
- TextMeshPro 3.0.6 or newer
- Unity Assets:
- Photon account and Photon Pun 2 asset 2.42.0 or newer
- KY Magic Effects Free 1.1.1 or newer
-
Create a new Unity 3D project and switch build platform to
Android
. -
Install and setup WaveXR Plugin.
- Follow Wave XR Plugin -- Getting Started to setup WaveXR in Unity.
- Follow this Wave XR Plugin -- Unity Marker to setup Trackable Marker.
-
Install following packages:
-
Install following assets:
- Photon Pun 2.
Note that you have to use your own PhotonApp ID
. See Photon Pun -- Setup and Connect for more information. - KY Magic Effects Free
- Photon Pun 2.
-
Import this project and setup build settings.
- Add the scenes in
Assets/SharedSpaceExperience/Scenes
to theScenes In Build
, and setLobby
scene as the entry scene.
- Add the scenes in
- Environment Setup
- Do
Room Setup
and make sure both VIVE XR Elites have the same floor height. - Place the ArUco marker in a fixed place.
- Do
- Install the App
- Build the project and install the APK on VIVE XR Elites by Android Debug Bridge.
- Play the Game
- Matching
- Launch the app. In the lobby, you can select the server with desired region in the top-right dropdown list. Make sure both players are in the same server.
- Click
Start
Button to start matching. The player who join the match first will be the host.
- Aligning Space
- The host have to scan and specify a marker for space alignment.
- To scan a marker, the player needs to look at it with VIVE XR Elite (in the front to get precise position). When the marker is detected, a marker frame will appear on the same spot. The players can then select the marker using the controller.
- To rescan the marker, first cover (or remove) the marker and look at the front of marker for about 10 seconds. Then uncover the marker and scan it again.
- After the host selects a marker, the other player has to scan and select the same one to align the space. Once the alignment is completed, players can see each other's virtual controller models and check whether the space has been properly aligned.
- The host have to scan and specify a marker for space alignment.
- Playing
- The game starts once the alignment process is completed.
- Attack: Press the trigger on the right controller to shoot magic orbs. Press the grip button to switch orb type.
- Defense: Use the shield attached on the left controller to prevent the health bricks from damage.
- The game ends when the time's up or one of the players loses all the health. All players will return to the lobby.
- The game starts once the alignment process is completed.
- Matching
-
Co-location and Markers:
- In the folder
Assets/SharedSpaceExperience/Scripts/Alignment
MarkerManager.cs
: Demonstrates the process of marker detection and how to convert ArUco marker into trackable markers.AlignmentManager.cs
: Demonstrates how to align the space between the host and other players.
- See Wave XR Plugin -- Unity Marker for more information about trackable markers.
- In the folder
-
MR Pass through:
Assets/SharedSpaceExperience/Scripts/Utils/PassThrough.cs
: Demonstrates how to enable pass through mode.- See Wave XR Plugin -- Passthrough for more information.
-
Debug:
- Press the menu button on the left controller (or
D
key when testing in Unity Editor) to enable debug mode.
- Press the menu button on the left controller (or
- Photon Pun 2 (not included in the project)
- KY Magic Effects Free (not included in the project)
- Unity Built-in Shaders 2020.3.36f1
See LICENSE.pdf for more information.
Email: [email protected]