Download presentation
Presentation is loading. Please wait.
1
Advanced 3D Art and Animation
Lesson N (week 14): Creating Unity Projects for VR
2
What is the HTC Vive? The VIVE is immersive Virtual Reality hardware and software with Spatial Visual and Audio systems allowing us to walk around a Virtual space. The VIVE includes: 1 Headset (tethered or free in the new versions) 2 Controllers (and microUSB chargers): include Trigger (bottom), Touchpad (top), On-button (below touchpad on top), Menu (above touchpad on top), and Side-grip buttons. 2 Base Stations: Need to face each other from high up (to not be blocked by players), at opposite corners of a space free of obstruction. Can be wall-mounted, but we use tripods for mobility. When stations correctly face each other they show small lit “B” & “C.” Cords for power (Base Stations) and connecting to the computer. The computer needs a sufficient graphics card to install and run the software (at least an NVidia GEFORCE 970). The Following tutorial is based on work by Taylor Ampatiellos and Marianne Chiarella, from notes here: It uses the SteamVR Interaction System to easily drag and drop key functions for making interactive experiences in Virtual Reality
3
What is Virtual Reality?
The modern wave of Virtual and Augmented Reality devices and software create intensely impactful experiences that use body kinesthetics as controllers, whether through full body movement with controllers or simply by moving our heads. VR (Occulus Rift, HTC VIVE, GearVR, Google Cardboard) offers full immersion in created spaces, while AR (Hololens, Vuforia, AR Kit or Arcode running on tablets or phones) creates holograms within or superimposed on the real world. Games are an obvious use for this tech, but it also offers extraordinary storytelling possibilities, including those explored by Baobab studios, as well as uses in medicine, education, and construction, to name a few.
4
Making 3D Models for Unity and VR
Set your Maya file to Meters. Create a scene in Maya (a living room is about 7x7 meters, for example). Use Extruded meshes (avoid unwelded Combines). Name each object. Keep polygon counts low: try to have no objects exceed 1k tri polys. To view polygons, open Display > Heads UP Display > PolyCount, and note the triangles (“tris”) for selected objects. Texture all objects: Create at least a solid color .PNG. Blinn materials for game objects is fine (Unity does not need Arnold materials). File > Export Selection each object as an FBX file, naming the file for the object. NOTE: If we export each object in their original arrangements around the space, we can automatically reproduce that arrangement in Unity by dragging the objects into the Hierarchy. Kitboxing refers to the 3D game practice of making objects that are meant to be re-used in many scenes, and such objects should be exported from Maya’s world center, after Freezing Transforms.
5
[PART A] Getting the VIVE Hardware Ready
To run Unity with a VIVE, first install SteamVR on the computer. Download the Steam App: Mouse over “Library,” find SteamVR. RightClick and choose Install Game. This is the software that runs the VIVE hardware from the computer (syncs up the Base Stations/ Sonar/ etc), and it will only install on machines with a graphics card powerful enough to run the VIVE. NOTE: For more information see the InteractionSystem.pdf in Assets > SteamVR > InteractionSystem downloaded with the SteamVR2 API from the Unity Asset Store.
6
[PART B] Starting the SteamVR Interaction System 1
Create a new 3D project in Unity. Open Window > General > Asset Store or [Ctrl/Cmd]+[9]. Search for “Steam” to find SteamVR Plugin. Download/import all components. When prompted by a pop-up from the SteamVR system, always Accept All.
7
[PART B] Starting the SteamVR Interaction System 2
Open the new “SteamVR” folder in your Project. Drag SteamVR > InteractionSystem > Core > Prefabs > [Player] into the Hierarchy. It has a camera, controllers, and inputs for pickups and teleportation. You can hide or replace hand meshes. Delete MainCamera from the Hierarchy. Add a GamObjects > 3D Objects > Cube (20, 0.1, 20) as a platform beneath [Player].
8
[PART B] Starting the SteamVR Interaction System 3
Hit the Play button. Because it is this project’s first time playing we MUST say “yes” to some popups: The 1st asks to Generate Actions for SteamVR Input. Select [Yes]! 2nd says the project is missing actions.json. Select [Yes] to generate a .json. 3rd is the SteamVR Input dialog. The Action Sets should be set to “Default.” Click [Save and Generate], close [x], and File > Save the Project. We also start seeing the window for Valve.VR.SteamVR_UnitySettyingsWindow which will appear frequently and always just needs us to click Accept All. TESTING TIME! Turn on controllers (button below touchpad), don headset. Look/walk around and see your controllers. Be careful to stay within the hologram walls that show space limits.
9
[PART C] Picking Things Up with VIVE in Unity
Add a GameObjects > 3D Objects > Cube near the center of the scene to be a table (set height to 0.75). Place smaller Cubes on top (0.1, 0.1, 0.1). Add Component > Rigidbody to the small cubes for physics properties. Drag this script onto the cubes: Assets > SteamVR > InteractionSystem > Core > Scripts > [Throwable]. This adds 3 Components to these objects, each with interesting parameters you can adjust: “Interactable” “Velocity Estimator” “Throwable” TESTING TIME! Start the scene, don headset. Move VIVE controllers near Cubes to highlight them in yellow. Squeeze triggers to pick them up. Pass cubes hand to hand, toss and catch.
10
[PART D] Teleportation
To avoid nausea, player movement should be handled with teleporting or actual walking. The Player prefab already has Teleportation Inputs ready; we just need to add Teleporting to the scene: Drag SteamVR > InteractionSystem > Teleport > Prefabs > Teleporting into the Hierarchy to set up teleport logic. To make the floor a teleport-able area: duplicate the floor, drag the copy just above the original floor, and drag onto it Teleport > Scripts > TeleportArea. To create specific teleport spots: drag into the scene Teleport > Prefabs > TeleportPoint and lift up until the white bottom circle is visible. TESTING TIME! Start the scene and don your headset. Press the touchpad to see a laser emit from your controller top to target a location, and release to teleport.
11
[PART E] Target Practice
Import the Target Practice files from the course site: Ding audio and TargetDetect Script. Add a Cylinder GameObject to the scene. Change Cylinder scale to make a thin disk. RotateX = 90, position a short distance from the [Player] (like a dart board on a wall). Remove the Collider Component currently on the disk. Add Component > Physics > TWO MeshColliders to the disk. Set one MeshCollider to be Convex and IsTrigger, to register impact for scoring/audio. Drag the “Ding” audio file onto the disk in Hierarchy. This adds an AudioSource Component to the disk. Turn off “Play on Awake”. Select a small cube. In the Inspector create/add a Tag called “BeanBag”. Add this Tag to all other pick-up-able cubes. Attach script TargetDetect.cs to the disk. TESTING TIME! Raise speaker volume, start scene, don headset. Pick up and throw cubes at the target. When you hit the target you should hear the “Ding” sound clip play!
12
[PART F] Create a Hinged Door
Create or import a Doorframe and a Door. Drag into the Hierarchy and position as desired. To the Doorframe: Add Component > Physics > Box Collider and RigidBody. Set Doorframe Rigidbody to IsKinematic so it does not move. To the Door: Add Component > Physics > Box Collider, RigidBody, and also Hinge Joint. Find “Connected Body” slot under Hinge Joint. Drag the Doorframe object from Hierarchy into that slot (will only work if Doorframe has a RigidBody and IsKinematic). The Hinge Axis starts in a corner. Set Axis = 0,1,0 (for a side-hinge), and set X, Y, and Z positions. Turn on Limits and set Max = 120 and Min = -120. TESTING TIME! The door will not react to controllers alone, but if you pick up an object and hold it or throw it at the door, the door will swing on its hinge.
13
Further Exploration Teleportation and picking-up and throwing objects are just the basics. There is so much to explore! Consider these topics: Thumb-pad interactions Shooting enemies Arc-based projectiles Nausea management Spatial and audio tracking Getting footage into the VIVE importing API (for Google Earth, etc) creating collider interaction and art for the player body—head, arms, feet Level building with all of these mechanics Adding snap-orientation to pickup Continue your VIVE journey here:
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.