ProjectS22
Contents |
VR Project
Prerequisites:
- Windows or Mac PC
- Unity
- VR headset with at least one 3D-tracked controller, such as the Oculus Quest 2, Rift (S), Vive, etc.
Recommended:
- GitHub Repository (accept from GitHub Classroom link)
Summary
For this assignment you can obtain 100 points, plus up to 10 points of extra credit.
The goal of this assignment is to create a VR application, which includes specific technical features, but can otherwise be anything you'd like.
All interaction has to be done through the VR system (headset and controllers). The user is not allowed to use keyboard or mouse while the VR app is running.
Getting Unity ready for VR
To enable Oculus VR support in Unity, use the Oculus Integration package from the Unity Asset Store. For SteamVR-compatible devices, there is a separate Unity asset. For other VR systems there should also be assets available. Contact us if you can't make your headset work.
Required technical features
Your application has to include the following technical features:
- A skybox to provide a background for your application.
- Colliders: create colliders for at least two objects and enable collision detection so that they can't penetrate each other.
- Highlighting: when selecting an object to move or otherwise interact with it, highlight it. This can be done in many different ways, for instance with a wireframe box around it, a glow around it, a change of color, or by making the object pulsate or blink.
- Physics engine: use physics for something. This could simply be gravity pulling floating objects to the ground.
- Move objects: the user has to be able to move at least one object by ray-casting with the controller: a ray emanates from the controller; if it intersects an object when the grab button is pressed, the object is 'skewered' and stays on the pointer ray until the button is released.
- Move the user: the user should move in the direction of the controller ray when the trigger button is pressed. The motion can be freely in 3D, locked to the ground, or constrained in some other way, depending on the app's circumstances.
- Sound effects: there needs to be at least one thing in the app that generates a sound. Background music satisfies this required, as well as a click type sound when the user presses a button, but many other options are possible.
If it doesn't make sense for your application to include one or more of the above features, please contact the instructor to discuss alternative features to substitute those.
Example
A VR app which can help with the furniture layout in UCSD's VR lab. The 3D application puts the user in a 3D model of the VR lab at 1:1 scale (i.e., life size). This ZIP file contains the room, as well as the furniture needed.
- Set up the room and place the user roughly in the center of it. You can choose to put some furniture in the space to make it look less empty.
- Create a way to spawn new pieces of furniture.
- Enable collision detection and physics in Unity and give the furniture as well as the room proper physics properties as well as colliders.
- Implement ray-casting to move furniture.
Tips
- To create a skybox in Unity: download a skybox from one of the links below and follow the steps in the skybox tutorial.
- http://www.f-lohmueller.de/pov_tut/skyboxer/skyboxer_3.htm (offline link)
- https://opengameart.org/content/elyvisions-skyboxes (offline link)
- These are lower resolution and need to be split up into the individual cube faces.
- These are very nice but need to be re-projected into cube maps (see below).
- If you created or downloaded a panorama image from the web, you need to convert it into the six cube map faces you need for the sky box. This web tool can do this for you.
- Object highlighting:
- A simple way to highlight an object is to draw its collider box, for instance with DrawWireCube.
- Another easy way is to draw a translucent sphere, overlaid onto the object.
- You could also give the object a different color, draw a different object instead (one that is highlighted), etc.
- To move objects:
- Display a line starting at your dominant hand's controller. The ray should point forward from the controller, much like a laser pointer would. The ray should be long enough to reach all of the walls of the lab.
- To select one of the desks or chairs in the room: find out which piece of furniture is intersected by the ray and highlight it. Update the highlight when the ray intersects a different piece of furniture. If the ray intersects multiple objects, highlight the object that is closest to the controller.
- Allow manipulation of the highlighted object when the user pulls the trigger button on the controller: move the object with the ray until the trigger button is released. The motion should resemble that of a marshmallow that you hold on a stick over a campfire. When the trigger button is released, the physics engine should take over and make the object fall down just like when initially spawned.
- To move the user (locomotion):
- There are many different ways you could move the user. Continuous motion is one of the easiest ones, instructions can be found at: https://sneakydaggergames.medium.com/vr-in-unity-how-to-create-a-continuous-movement-system-track-real-space-movement-2bd6fe31df0a
- Alternatively, you can try to implement teleportation, or any other way that suits your application.
- To implement colliders:
- Focus on box colliders
- Find instructions at: https://www.codinblack.com/colliders-and-triggers-in-unity3d/
- Sound effects:
- You need to define a listener position, and an audio source
- You can use default parameters for all other sound parameters
- Instructions are at: https://www.studytonight.com/game-development-in-2D/audio-in-unity
Submission Instructions
Once you are done implementing the project, record a video demonstrating all the functionality you have implemented.
The video should be no longer than 5 minutes. The video format should ideally be MP4, but any other standard format will also work.
While recording the video, record your voice explaining what aspects of the project requirements are covered. Record the video off the action in the VR headset.
To create the video you don't need to use video editing software.
- The Oculus Quest 2 has a built-in way to record video.
- On any platform, you should be able to use Zoom to record a video.
- For Windows:
- Windows 10 has a built-in screen recorder
- If that doesn't work, the free OBS Studio is very good.
- On Macs you can use Quicktime.