Rather than playing around augmented reality from the last two projects, for this project, we are going to be working with virtual reality this time. For this assignment, we are supposed to be creating our own dream classroom space. In order to do this, we will be using the professor's sample project, which has a classroom already made for us, and we edit the classroom however we like from there. For the theme of my dream classroom, I decided to make my classroom look like a house party by adding Unity Store assets I found such as speakers, vending machines, food, etc. I also add in some cool interactions to make it seem like a house party such as having some of the character models dance when you get close to them, or having a vending machine spit out soda cans, which is a typical party drink. We also have a corner where I have a character model watching television, and there's a lot more that makes it feel like a house party.
Overall, the main goal of this project is to work with virtual reality and help us get familiar with programming in VR. Even though we are only using a VR simulator, this is still the general idea of how to get the functionality to work.
Some things you could do with this application is you can pick up objects that are small or usually don't weigh that much. From the images on the left, these are the 10+ small objects that I chose to put on the desk area around my avatar. Some of the typical items I would bring to class would be my laptop, phone, iPad and my backpack. Some other items I added that I would bring to class if it was appropriate would be some food with a plate, a wine bottle and glass, my soccer ball and my guitar.
All of these objects have rigid bodies and appropriate colliders, so they can be dropped on the table or floor properly, or they can push other items that also have colliders on them, but only if they are small objects. There are more small objects around the room that you can also pick up, but these are just examples of some of the items that you could try picking up in the application.
In order to pick up an object, you would have to move one of the hand controllers (The red and green dots in the first picture) to the object you want to pick up. You would have to press LeftAlt to get access to the controllers. You would then have access to move the green controller anywhere, but only horizontally. In order to move vertically, you would have to hold LeftControl while moving the mouse up or down.
When the object is highlighted yellow/light green, this indicates that the controller is on the object. You can then pick it up by clicking on the LeftMouseButton. You can then drop it or throw it by clicking LeftMouseButton again.
Another thing you could do with the application is play around with some of the large objects in the room. You aren't able to grab or move the large objects (since they are typically heavy in real life), but you are able to interact with some of them. For example, the TV in the application is one of the large objects you can interact with. When you touch the TV with the hand controller, you will see that the TV gets highlighted, indicating that the hand controller is currently on the object, but also the screen will also turn on. For the screen image, I decided to put one of my favorite TV shows, JoJo's Bizarre Adventures. Not only that, but I also added some music that was part of the part of the show to make the scene feel more realistic.
The TV will keep playing the audio and showing the screen image until the user turns it off. In order to turn off the TV, you have to touch the TV remote next to the TV with the hand controller. I thought this made it feel realistic because you usually use a remote to turn a TV on or off. In this case, however, the remote will only turn the TV off. You can also pick up the remote too since it is a small object. Wherever the remote is in the room (if you decide to pick up the remote and move it somewhere), the TV will turn off once the remote is touched or picked up.
In case the user gets confused, there are some instructions on the whiteboard that say how to turn the TV on or off.
The stereo speaker is another large object you can't move, but you can still interact with it. When you touch the top-centered stereo speaker with the hand controller, you will hear music start to play from all four speakers. I really liked this because it kind of has a surround sound effect that makes it feel like an actual speaker.
When you touch the top-centered stereo speaker again with the hand controller, it will turn off the music if the music was playing, which also makes it feel realistic because usually on stereos, the on or off buttons would be together, so it only makes sense to have it turn off and on from the same stereo instead of two separate stereos.
Another requirement for the project is to have a large object generate a small object in the room when the user touches it, and then have the small objects become interactable. For my application, since my theme is a house party, I decided to add a vending machine and have it spit out soda cans from the bottom compartment. It's a little hard to tell from the middle image, but generally, when the user touches the machine with the hand controller, the vending machine will highlight, indicating that it is being touched by the hand controller, but also flings the soda can in the air and then it drops to the ground. You can then interact with the soda cans, since they are small objects, by picking them up and throwing them around.
Another thing you could do is play around with the light switches. I added four different light switches that are color-coded, and when the user touches that colored switch, the lights will change and fill the room with that color.
As you can see from the images on the left, when the user touches the red switch, the lights will turn red. When they touch the pink switch, the lights will turn pink and so on for every other switch. In order to stop the colored lights, the user would have to touch the normal light switches. Touching the on light switch will turn off the colored lights and keep the normal white lights on. Touching the off light switch will turn off all the lights, including the normal white lights.
Finally, you can also interact with every character in the application if you get close to them. From the left image, you can see one of the characters is just standing around and not doing anything. When you get close to them, however, their animation will change and they will say a voice line that relates to what they're doing. So for example, I have this character standing next to the stereo speakers. When I get close to the character, they will start dancing as you can see from the right image, but they will also say a voice line saying something about the music. There are four other characters that also do something when you get close to them, so be sure to play around with them as well!
Below is a short video demonstrating how this application works.
You can click the link on top of this page to take you to my GitHub project or click here. When you get to the page, click on the green button that says "Code" and a few options appear. If you have git installed on your computer, you can clone the repository by following the set of commands found here. If you don't have git installed or you don't want to do that, however, you can just download the ZIP file by clicking on the option shown, and unzip the folder.
In order to run this project, you must have Unity Version 2019.4.1f1 and VRTK 3 downloaded on your computer. The VRTK 3 files should already be included when you download the project, so you would just need to make sure you have the correct Unity Version.
You must also have Blender 2.8.3 or higher installed on your computer or else you may end up missing some components of the project such as the walls.
In order to use this program, you must open the project on Unity and press Play from there. When you press Play, you will see at the top left that there are a list of keys you can use in order to do things such as moving around, grabbing things, throwing stuff, etc. You can follow this set of keys it gives you in order to figure out how to work the VR stuff.
None of the assets or character models except my avatar and the girl models are made by me. For a list of sources I used not made by me, click here.