Displaying Objects in VR with MetaQuest

0. Contents of This Article

This article introduces the steps to display 3D objects (cubes) in VR with Meta Quest. You'll learn the fundamentals of VR applications, from basic camera setup with Meta XR SDK to object placement and testing on actual hardware.
You can also check the operation in the 01-ShowObject scene of the sample published on GitHub.

QuestVR Basic

This article continues from the following. Please check if your settings match.

Meta XR SDK Installation and Project Setup

1. Creating a Scene

[Creating a New Scene]

  • Click File -> New Scene
  • Select Basic(URP) in the New Scene window and click Create

New Scene Creation Screen

  • Click File -> Save
  • Set the scene name and save
    This article uses *ShowObject

2. Setting Up the Quest Camera

[Placing the Camera Rig]

  • Delete the Main Camera in the Hierarchy
  • Enter CameraRig in the Project tab search area
  • Select All from Search: directly under the search area
  • Drag and drop OVRCameraRig into the Hierarchy
  • If Project Setup Tool Fix Available appears, click Fix Project Setup Tool Fix

[OVR Manager Configuration]

  • Click OVRCameraRig in the Hierarchy
  • Find OVR Manager in the Inspector to set detailed information for Quest
  • Select Floor Level for Tracking Origin Type in the Tracking item
    *Tracking Origin Type is important for determining the origin height
ModeDescription
Floor LevelFloor height is the origin
Eye LevelQuest height when the app starts is the origin

Select Floor Level if you want to fix object display height relative to the room, and select *Eye Level if you want to fix objects relative to Quest's initial position.

3. Displaying Controllers and Hands

This article doesn't introduce interactions with hands or controllers, but these will be used in subsequent articles. Also, it's enjoyable to visually confirm that hands and controllers are recognized by Quest during testing, so I'll introduce the setup procedure.

[Adding Interaction Features]

  • Enter OVRInteractionComprehensive in the Project tab search area
  • Select All from Search: directly under the search area
  • Drag and drop OVRInteractionComprehensive into OVRCameraRig as a child element

OVRInteractionComprehensive

[Hand Tracking Configuration]

  • Click OVRCameraRig in the Hierarchy
  • Find OVR Manager in the Inspector to set detailed information for Quest
  • Find Hand Tracking Support in the Quest Features section and select your preferred mode
    This series assumes *Controllers and Hands is selected.
Setting NameDescription
Controllers OnlyOnly controllers work, hand tracking is disabled
Controllers and HandsBoth controllers and hand tracking work
Hands OnlyOnly hand tracking works


  [Always Display Controller Ray (Optional)]
Ray Object
The Ray object that indicates the controller's pointing direction is not always displayed. Of course, this is fine as is, but if you want the Ray object to always be displayed, you can set it up with the following procedure.

  • Open LeftInteractions child element of OVRInteractionComprehensive
  • Further open Interactors -> Controller -> ControllerRayInteractor -> Visuals
  • Click ControllerRay child element of Visuals
  • Pay attention to Controller Ray Visual in the Inspector
  • Turn OFF the Hide When No Interactable checkbox
  • Perform the same operation for RightInteractions to set the right hand Ray

Ray Object Visibility


4. Object Placement

[Creating a Cube]

  • Right-click in the empty space of the Hierarchy with no other objects selected
  • Click 3D Object -> Cube

Cube Creation Screen

[Position and Size Adjustment]

  • Click the Cube added to the Hierarchy
  • Set the Cube's position, rotation, and size in the Transform section of the Inspector
    *This article uses the following settings to display a slightly tilted 0.3m cube at 1.3m height from the floor, 1m ahead from the origin
ItemXYZ
Position01.31
Rotation0200
Scale0.30.30.3

Transform Settings Screen

5. Testing

[Installing on Actual Device]

  • Connect Quest and PC with USB cable
  • Click File -> Build Settings in Unity Editor
  • Click Build And Run
  • Set installer (apk) name in alphanumeric characters and save
  • After installer generation and installation complete, the app automatically starts in Quest
  • A cube should appear in front of you. If it appears in a different direction, press and hold the meta (oculus) button on the right controller to reset orientation
  • If installation errors occur, review settings or create only the apk with Build and install the app from SideQuest or MetaQuestDeveloperHub

[Using Meta Quest Link (Windows)]

For details, see the official page.

  • Connect Quest and PC with USB cable
  • Start Quest Link in Quest
  • Click the Play button in Unity Editor
  • A cube should appear in front of you. If it appears in a different direction, press and hold the meta (oculus) button on the right controller to reset orientation

6. Next Steps

You've now achieved basic object display in VR. Next, we'll explain AR display using the passthrough feature.

AR Display Using MetaQuest Passthrough

7. Complete List of Meta XR SDK Articles

Getting Started with Meta XR SDK Quest App Development

0
Subscribe to my newsletter

Read articles from Takashi Yoshinaga directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Takashi Yoshinaga
Takashi Yoshinaga