Difference between revisions of "Project1S17"
(→Extra Credit (Max. 10 Points)) |
(→Extra Credit (Max. 10 Points)) |
||
(5 intermediate revisions by one user not shown) | |||
Line 22: | Line 22: | ||
* Pick out a factory model from the list below (or a different one of your choice) and load it into memory. A good way to load it is with the [http://www.assimp.org/ Assimp library] as described on the discussion slides. (10 points) | * Pick out a factory model from the list below (or a different one of your choice) and load it into memory. A good way to load it is with the [http://www.assimp.org/ Assimp library] as described on the discussion slides. (10 points) | ||
* Place the factory model as a miniature model (~1 foot wide) in front of the user and just below table height. (5 points) | * Place the factory model as a miniature model (~1 foot wide) in front of the user and just below table height. (5 points) | ||
− | * Have the factory emit a CO2 molecule every ~1 second. Start the game with 5 CO2 molecules floating in the air. The CO2 molecules each need to have independent initial (upwards) velocity and spin. Their initial velocity and spin should be randomized. For a 3D model of CO2 see below. Scale the molecule so that each atom is about the size of a tennis ball. (20 points) | + | * Have the factory emit a CO2 molecule every ~1 second. Start the game with 5 CO2 molecules floating in the air. The CO2 molecules each need to have independent initial (upwards) velocity and spin. Their initial velocity and spin should be randomized. For a 3D model of CO2 see below. Scale the molecule so that each atom is about the size of a tennis ball (7cm diameter). (20 points) |
* Define an invisible box (about 3 foot cubed) in front of the user which keeps the CO2 molecules contained and makes them bounce off the walls. The bouncing can be done very simply by negating the coordinate axis which would make the molecule escape the bounding box. (5 points) | * Define an invisible box (about 3 foot cubed) in front of the user which keeps the CO2 molecules contained and makes them bounce off the walls. The bouncing can be done very simply by negating the coordinate axis which would make the molecule escape the bounding box. (5 points) | ||
* Add support for the Oculus Touch controllers. Display a green laser beam as an OpenGL line or a thin cylinder, emanating from the location of each touch controller. (20 points) | * Add support for the Oculus Touch controllers. Display a green laser beam as an OpenGL line or a thin cylinder, emanating from the location of each touch controller. (20 points) | ||
Line 30: | Line 30: | ||
* Once all molecules have been eliminated, the trainee wins and the factory stops producing CO2. Change the background color to light blue in this case to indicate the victory. (5 points) | * Once all molecules have been eliminated, the trainee wins and the factory stops producing CO2. Change the background color to light blue in this case to indicate the victory. (5 points) | ||
* After the game ends, show win or lose state until the user presses any one of the controller buttons (not triggers), then restart the game. (5 points) | * After the game ends, show win or lose state until the user presses any one of the controller buttons (not triggers), then restart the game. (5 points) | ||
+ | |||
+ | '''Grading:''' | ||
+ | * -3 if model colored incorrectly | ||
+ | * -3 if molecules don't spawn from factory | ||
+ | * -3 if molecules don't spin | ||
+ | * -5 if lines don't move correctly with controllers | ||
==3D Assets== | ==3D Assets== | ||
Line 47: | Line 53: | ||
Options for extra credit are: | Options for extra credit are: | ||
− | * Audio: use the [http://www.softpedia.com/get/Programming/SDK-DDK/Oculus-Audio-SDK.shtml#download Oculus Audio SDK] to play sounds for eliminating C molecules, generating new ones in the factory, and a sound for when the game is won. (10 points) | + | * Audio: use the [http://www.softpedia.com/get/Programming/SDK-DDK/Oculus-Audio-SDK.shtml#download Oculus Audio SDK] to play sounds for eliminating C molecules (sound should come from location of eliminated molecule), generating new ones in the factory (sound should come from spawn location), and a sound for when the game is won. (10 points) Note: must use Oculus SDK to get full points. |
* Haptic feedback: the Oculus Touch controllers have built in vibration generators. Add support for vibration feedback for when a C molecule is eliminated, and potentially other events. (5 points) | * Haptic feedback: the Oculus Touch controllers have built in vibration generators. Add support for vibration feedback for when a C molecule is eliminated, and potentially other events. (5 points) | ||
− | * Draw hands: use the Oculus Avatar SDK to show stylized touch controllers in their correct locations (where the user's hands are). (10 points) | + | * Draw hands: use the [https://developer3.oculus.com/documentation/avatarsdk/latest/concepts/avatars-sdk-intro/ Oculus Avatar SDK] to show stylized hands and/or touch controllers in their correct locations (where the user's physical hands are). (10 points) |
Latest revision as of 12:26, 21 April 2017
Contents |
Carbon Dioxide Removal Trainer
It appears that everybody can agree that our planet's climate is changing and we're observing global warming. What we can't all agree on is why it is happening, and what role CO2 plays in it. And whether or not humans are contributing to it. Regardless, we need to be prepared to do something about it once the truth comes out. Or else our beloved Pacific Beach turns into Atlantis. And the glider port turns into kite surf port.
If it does turn out that CO2 is the bad guy, we need to learn how to eliminate it. That's what the Carbon Dioxide Removal Trainer is for. And you are going to have to build it.
Everyone knows that a CO2 molecule can be turned into oxygen (O2) by eliminating the C. The way to eliminate the C is to aim two lasers at it, each of which alone can't harm the C or the Os, but in combination they turn it into dust (which has not been found guilty for global warming yet).
Starter Code
We recommend using the Oculus Minimal Example code from GitHub to start with. It's very compact but yet uses most of the API functions you will need. The code is slightly outdated though and will require some updating. Fixed version here so you don't need to deal with Visual Studio as much
To better understand how the Oculus API works, we recommend this example from Oculus. It is up to date for the current version of the Oculus SDK and can be very useful.
Project Description (100 Points)
Download the starter code and get it to work with the Oculus Rift. (5 points)
Based on the starter code, write a VR application for the Oculus Rift and the Touch controllers with the Oculus SDK in C++ and OpenGL (no Unity etc). Here are step by step instructions for it:
- Make the background color of the application a dark blue (for a dark blue sky). (5 points)
- Pick out a factory model from the list below (or a different one of your choice) and load it into memory. A good way to load it is with the Assimp library as described on the discussion slides. (10 points)
- Place the factory model as a miniature model (~1 foot wide) in front of the user and just below table height. (5 points)
- Have the factory emit a CO2 molecule every ~1 second. Start the game with 5 CO2 molecules floating in the air. The CO2 molecules each need to have independent initial (upwards) velocity and spin. Their initial velocity and spin should be randomized. For a 3D model of CO2 see below. Scale the molecule so that each atom is about the size of a tennis ball (7cm diameter). (20 points)
- Define an invisible box (about 3 foot cubed) in front of the user which keeps the CO2 molecules contained and makes them bounce off the walls. The bouncing can be done very simply by negating the coordinate axis which would make the molecule escape the bounding box. (5 points)
- Add support for the Oculus Touch controllers. Display a green laser beam as an OpenGL line or a thin cylinder, emanating from the location of each touch controller. (20 points)
- When the user pulls the index finger trigger, change the color of the laser of that Touch controller to red. (5 points)
- When both triggers are pulled, and the user points both laser beams at a C atom so that they both intersect the atom's bounding sphere, the C atom should disappear and an O2 molecule remains. For a 3D model of O2 see below. (10 points)
- Once more than 10 molecules are in the environment, the trainee loses. To visually indicate the loss you should draw 100 or more CO2 molecules in random locations in the environment. (5 points)
- Once all molecules have been eliminated, the trainee wins and the factory stops producing CO2. Change the background color to light blue in this case to indicate the victory. (5 points)
- After the game ends, show win or lose state until the user presses any one of the controller buttons (not triggers), then restart the game. (5 points)
Grading:
- -3 if model colored incorrectly
- -3 if molecules don't spawn from factory
- -3 if molecules don't spin
- -5 if lines don't move correctly with controllers
3D Assets
We provide the following 3D models for you to use in your application, in this zip file:
- CO2 molecule
- O2 molecule
- 4 factory models to choose from. The pictures below are in order, factory1..factory4.
To import these OBJ files, we suggest using the Assimp library.
Extra Credit (Max. 10 Points)
Options for extra credit are:
- Audio: use the Oculus Audio SDK to play sounds for eliminating C molecules (sound should come from location of eliminated molecule), generating new ones in the factory (sound should come from spawn location), and a sound for when the game is won. (10 points) Note: must use Oculus SDK to get full points.
- Haptic feedback: the Oculus Touch controllers have built in vibration generators. Add support for vibration feedback for when a C molecule is eliminated, and potentially other events. (5 points)
- Draw hands: use the Oculus Avatar SDK to show stylized hands and/or touch controllers in their correct locations (where the user's physical hands are). (10 points)