Termbank
  1. C
    1. Course Schedule
  2. L
    1. Lecture Slides
      Reading
  3. O
    1. Oculus Best Practices Guide
      Reading
  4. U
    1. Unity
      Platform
  5. V
    1. Virtual Reality, LaValle 2016
      Reading
  6. Y
    1. YouTube Lectures: VR Systems and Humans
      Content
Completed: / exercises

Project Part 3: VR Cardboard Interactions

Due date: 2026-11-13 23:59.
Have you wondered why interaction is limited in all the Cardboard VR experiences you’ve tried so far? Without 6DOF positional tracking and controllers, Cardboard VR doesn't allow for simulating walking, grabbing, or many other interactions possible with high-end HMDs. Until this homework, that is.... It turns out there is a way to create meaningful interactions, even with 3DOF orientation-only tracking systems.

Before starting...

If you haven't done it yet, we recommend setting up version control as a way to help avoid potential problems that could cause you to lose progress. Here is a quick tutorial: GitHub Desktop for Unity

Interactions in 3DOF VR

Let us look at the example in the image below:
How could you move that cube with a Cardboard?
It turns out there are more ways than previously thought! We have defined four basic Cardboard interaction methods for you: Twist, Dwell (also known as gaze input), Press and Hold.
Twist refers to, well, twisting your head - rotating it on the roll axis until a certain angle, at which point an action is triggered. In this case, picking up or dropping the cube. To see how it can be done - start with downloading and running the .apk we have created for you:
Dwell means looking at an interactable object until a timer completes, at which point some action is triggered. It is the "classic" 3DOF input method, used in many applications.
Press utilizes the trigger button found on the side of the Cardboard. It uses a conductive strip to touch the screen to register an input. Finally, Hold is an extension of press, where holding the trigger down for a set time causes an action to be executed.
Beyond the basics, your imagination is the only limit. You could combine or modify the former interactions to form new ones. Other input methods, such as utilizing the smartphone microphone or camera, are also possible for those who want the extra challenge.

User Friendly UIs

A good method of interaction should provide feedback to the user so they understand what's happening. Let's take the Twist for example. First, to visualize you are looking at an interactable object, a double crosshair like this appears in the middle of your field of view in VR:
The first crosshair will rotate if you roll your head, the other one will not. And so, to interact with this object that you are looking at, you must make the crosshairs line up by rolling your head:
In VR, it could look like this:
By rolling your head, the object can be interacted with, in this case grabbed!

Implementation

While anyone could implement this from scratch, we are providing you with a Unity package that you can import to your project. This package includes the four basic interactions. Get it here:
To use this package, you can either drag and drop it to your project assets view in the Unity editor, or right click empty space in that view and choose the Import Package option from the context menu. You should then get a prompt to choose which files to import from the package, so make sure to import them all.
After that, you should have a CardboardInteract folder in your assets. From there, drag and drop the Interactor prefab on the Main Camera in your scene. There are some options in the inspector for that prefab, but you can leave them as they are for now, but make sure the position and rotation of Interactor is all set to 0! Remember to disable the old CardboardReticlePointer.
Now, all that is left is to add interactable objects! For a simple test, add the included Interactive script to an object, then play the scene in the Unity Editor and manipulate the rotation of the main camera through the Unity inspector to perform the twist interaction on the object, and there should be a message in the Console view!
In order to create your own interaction, you must create scripts that inherit Interactive. You can do this by creating a script as you normally would, such as by choosing Add Component in the inspector when you have an object selected in the scene that you want to make interactive, and typing a name you want to give and selecting New script. After this new script is added, open the script in Visual Studio or another editor of your choice (by double clicking the script name in the inspector or in the assets view). In the script, change the MonoBehaviour to Interactive, as that is where it's defined what class is inherited.
In order to add your interaction logic, create a function public new void Interact() which will override the print statement we tested earlier. This function will be called when the user interacts with this object. You can fill this function with any interaction logic you want! Make the object jump, change color, whatever you want. Feel free to also add any other function, and you can use the Unity default Update and Start functions too if you want.
Assign the Interact Mode Override in the Editor to select which interaction method you want this object to use.
You can also assign overrides for the Twister angle and Dwell timer. This is useful if you want different interactions to have different sensitivity to trigger them. For example, teleporting using the Twist should have a lower sensitivity than selecting something. You can also change the default parameters in the CameraInteract component. Press and Hold parameters can also be changed in the TriggerInteract component, but not per-object.

Teleporting and Grabbing

The package has now been updated with teleportation and grabbing scripts. These are not required, but will be helpful in creating a more interactive project!
In order to use teleportation, add the TeleportSurface component to the floor. It is recommended to create a new Plane for this purpose so the teleportation area is bound to other geometry. You can delete the Mesh Renderer from this new object. This way, we can define the teleportation area without affecting the visuals. Make sure the plane is on top of other colliders, or make use of Layers to bypass other colliders. For teleportation using Twist, consider adjusting the Twist Multiplier Override to something lower than default, such as 4, if you feel like accidental teleportations might be a problem! Also, once again, make sure the position and rotation of Interactor is all set to 0 for any of this to work correctly!
As for grabbing, simply add the Grabbable component to an object that you wish to be grabbable, and make sure that object has both a collider and the Rigidbody component. You can now for example twist to grab the object and twist again to let go! Try adjusting the Grab Speed to control how quickly the object follows your gaze, and set whether the object should use gravity here (gravity is always off while grabbed, so it needs to be controlled here). You can even throw objects by giving them some momentum right before letting go!

Global Trigger

The TriggerInteract component is slightly different from CameraInteract in that it can register input regardless of whether the player is looking at an interactable object. This allows you to define a separate action for trigger presses that aren't targeting an object. Unlike object-specific interactions however, this action is global, meaning the same logic is executed for all such trigger presses. You can define these actions yourself in the GlobalTriggerPress and GlobalTriggerHold scripts:
By default, the GlobalTriggerHold recenters the Cardboard view after 3 seconds. This is an updated version of the original recentering. To avoid conflicts, it is recommended to delete or comment out the original recentering in CardboardStartup.cs as shown below.

Submitting Your Work

Submit a YouTube, Google Drive, or similar link to a video of your working twister interaction. The video must clearly show the reticles appearing over the interactable object and the resulting change in the object when interaction occurs. You don't have to use this in your final project, but you need to show us you can use the interaction system.
  • The video should show gameplay recorded from your phone, displaying the two stereoscopic views.
  • If you are using your own HMD, submit a video of gameplay showing the twister implemented for a controller instead.
  • Keep the video short and clear (30–90 seconds is ideal).
  • Make sure you give us permission to view your video, to minimize any delays with grading.
This exercise can be submitted once per group.

Warning: You have not logged in. You cannot answer.

Authors

Elmeri Uotila, Teemu Kulojärvi, Anna LaValle.
?
Lectures and labs schedule for the VR Systems and Humans course
Lecture slides, VR Systems and Humans course, University of Oulu
Informative Guides to Help You Design, Develop, and Distribute Your VR App.
The platform for interactive, real-time, 3D content creation.
Virtual Reality, LaValle 2016 is the free online textbook we use in this course.
YouTube Channel: 2025, IIT Madras - University of Oulu, Foundations of Virtual Reality, NPTEL course.