My Very First QWR VRone Unity3D VR App1

This tutorial will guide you through the creation of the first VR application using the QWR VRone Unity3D SDK.

1. Create a new Unity project

2. Import QWR_VRone_SDK.unitypackage

The QWR VRone SDK is based on Unity 5.3.0. If you are using a later version, Unity will prompt you to upgrade API when importing the plugin.

If the upgrade window does not pop up automatically, please close the project and reopen it.

3. Unity Settings

  • Follow Unity Project Settings guide and complete the project settings

  • Find the Game Tab and add an Aspect Label (1024 x 1024). The aspect ratio of a single eye is 1:1

  • Please select Android platform and Switch Platform.

4. Create a scene

  • Create a folder named "Example" under "Assets" folder

  • Create a scene named "ExampleScene" inside "Example" folder

  • Open "ExampleScene"

5. Replace the Main Camera with QwrCameraRig prefab

  • Locate QwrCameraRig (Assets/QWR/Prefabs/QwrCameraRig) and drag it into the scene.

  • Delete the Main Camera

  • An empty VR scene is completed so far.

6. Create a 3D Object

  • Create a cube and set its properties.

  • Create a Sphere and set its properties.

7. Create a UI

  • Create a Canvas and set the properties. (Render Mode must be set to World Space).

  • Replace EventSystem with QwrEventSystem.

When creating a Canvas, Unity will create an EventSystem by default. Unity's default EventSystem can only handle events such as mouse and touch screen, it needs to be modified to support VR devices such as HMD and controllers. The UI interaction is taken place at the position of the ReticlePointer instead of the touch point of a touchpad, or the location of the mouse.

Find the QwrEventSystem prefab (Assets/QWR/Prefabs/QwrEventSystem) and drag it into the scene and delete the EventSystem.

  • Create a Button object under Canvas and set its properties.

  • Create a DropDown object under Canvas and set its properties

8. After completing the above steps, the scene is as shown below

9. Debug run in editor mode

Play the scene. Hold down the Alt key, move the mouse around with the right mouse button pressed to look around. You will see that when the reticle point intersects with the UI, its shape changes from a point to a circle. Left-clicking the mouse triggers a UI click event.

When the reticle point intersects with the 3D object, its shape changes from a point to a circle.

Whether the reticle point will become a circle depends on whether the interacting object has an IPointerEnterHandler.

For example, adding the component EventTrigger to the Cube will become a circle when the cursor interacts with the Cube.

Whether the reticle point will interact with the 3D object depends on whether the object has a collision component.

10. Build and run on VR device

Click "Build And Run", make sure the Android platform is selected.

At this point, you have completed your very first VR application.

Last updated