Difference between revisions of "Project1S19"

From Immersive Visualization Lab Wiki
Jump to: navigation, search
(Extra Credit (Max. 10 Points))
(Where's Waldo 3D)
 
(4 intermediate revisions by one user not shown)
Line 2: Line 2:
  
 
In this first programming project of the course you need to extend our starter code to a game in which the player needs to find a highlighted sphere among a 3D array of similar spheres, and click on it. The player has one minute to click on as many highlighted spheres as possible.
 
In this first programming project of the course you need to extend our starter code to a game in which the player needs to find a highlighted sphere among a 3D array of similar spheres, and click on it. The player has one minute to click on as many highlighted spheres as possible.
 +
 +
This project is a team project: it should be done in teams of two. But individual submissions are allowed as well.
  
 
==Starter Code==
 
==Starter Code==
Line 9: Line 11:
 
To the minimum example you will need to add controller support, which [[OculusControllerCode |this piece of sample code]] illustrates how it can be done. You can add this code to the draw() function of the minimal example to get printouts of the controller parameters. To see the <tt>cerr</tt> messages you have to display the terminal window, which you can do by replacing the line with <tt>WinMain</tt> with this one: <tt>int main(int argc, char** argv);</tt>
 
To the minimum example you will need to add controller support, which [[OculusControllerCode |this piece of sample code]] illustrates how it can be done. You can add this code to the draw() function of the minimal example to get printouts of the controller parameters. To see the <tt>cerr</tt> messages you have to display the terminal window, which you can do by replacing the line with <tt>WinMain</tt> with this one: <tt>int main(int argc, char** argv);</tt>
  
To better understand how the Oculus API works, we recommend [https://developer3.oculus.com/documentation/pcsdk/latest/concepts/dg-sensor/ this example from Oculus]. It is up to date for the current version of the Oculus SDK and can be very useful.
+
To better understand how the Oculus API works, we recommend [https://developer3.oculus.com/documentation/pcsdk/latest/concepts/dg-sensor/ this example from Oculus].
  
 
==Project Description (100 Points)==
 
==Project Description (100 Points)==
Line 18: Line 20:
  
 
* Use a background color of your choice other than black for your application (5 points).
 
* Use a background color of your choice other than black for your application (5 points).
* Use the class oglplus::shapes::Sphere to create a sphere and display it at the user's dominant hand's controller position. This is the cursor sphere. (Alternatively, if you a cursor that isn't a sphere, you can load a 3D model of your choice using the [http://www.assimp.org/ Assimp library].) (10 points)
+
* Load the [http://ivl.calit2.net/wiki/images/a/a9/Sphere2.zip the OBJ file of a sphere] and display it at the user's dominant hand's controller position. This is the cursor. To load the sphere you can use the [http://www.assimp.org/ Assimp library]. (10 points)
* Create and render a 3D array of 5x5x5 = 125 spheres in a color of your choice. Each sphere should be the size of a tennis ball (0.07 meters diameter), and the balls' center points should be 0.14 meters apart from one another in all three dimensions. (10 points)
+
* Create and render a 3D array of 5x5x5 = 125 spheres in a color of your choice. Each sphere should be the size of a tennis ball (0.07 meters '''diameter'''), and the balls' center points should be 0.14 meters apart from one another in all three dimensions. (10 points)
 
* Wait for the user to pull the trigger button (index finger) to start the game. (10 points)
 
* Wait for the user to pull the trigger button (index finger) to start the game. (10 points)
 
* Create a way to change the color of a random sphere of the array to highlight it. (10 points)
 
* Create a way to change the color of a random sphere of the array to highlight it. (10 points)
Line 26: Line 28:
 
* Repeat the above until one minute has passed since the game was started. (10 points)
 
* Repeat the above until one minute has passed since the game was started. (10 points)
 
* Display the number of correctly clicked spheres in the terminal window (not in VR), and restart the game. (10 points)
 
* Display the number of correctly clicked spheres in the terminal window (not in VR), and restart the game. (10 points)
 +
 +
'''Grading:'''
 +
* -3 points if spheres aren't 0.07 meters in diameter
 +
* -3 points if spheres aren't 0.14 meters apart from each other
  
 
==Extra Credit (Max. 10 Points)==
 
==Extra Credit (Max. 10 Points)==
Line 34: Line 40:
 
* New game play: come up with a game that also involves clicking on things but is more fun than the homework project. (up to 10 points)
 
* New game play: come up with a game that also involves clicking on things but is more fun than the homework project. (up to 10 points)
 
* Instead of displaying text in the terminal window, display all text within the VR environment. You need to display at least the following things: a message to start the game, a countdown timer that shows the remaining seconds in the game, a message that the game is over along with the number of correctly clicked spheres. (5 points)
 
* Instead of displaying text in the terminal window, display all text within the VR environment. You need to display at least the following things: a message to start the game, a countdown timer that shows the remaining seconds in the game, a message that the game is over along with the number of correctly clicked spheres. (5 points)
* Support grabbing the set of spheres with the controller in the non-dominant hand: pressing and holding a button on the controller grabs the entire set of spheres as if they're all invisibly connected rigidly to the user's hand (they need to both translate and rotate with the hand). Once the button is released the movement of the spheres stops. (5 points)
+
* Support grabbing the set of spheres with the controller in the non-dominant hand: pressing and holding a button on the controller anywhere in space grabs the entire set of spheres as if they're all invisibly connected rigidly to the user's hand. They cannot snap to the hand but have to stay put when the user presses the button. While the user holds the button down, the spheres need to both translate and rotate with the controller. Once the button is released the movement of the spheres stops. (5 points)
 
* Instead of (or in addition to) highlighting the sphere that is to be clicked on, wrap a [https://metrouk2.files.wordpress.com/2012/09/article-1346848996385-14d8f9fb000005dc-43911_636x475.jpg picture of Waldo] around it as a texture. (5 points)
 
* Instead of (or in addition to) highlighting the sphere that is to be clicked on, wrap a [https://metrouk2.files.wordpress.com/2012/09/article-1346848996385-14d8f9fb000005dc-43911_636x475.jpg picture of Waldo] around it as a texture. (5 points)

Latest revision as of 14:57, 3 May 2019

Contents

Where's Waldo 3D

In this first programming project of the course you need to extend our starter code to a game in which the player needs to find a highlighted sphere among a 3D array of similar spheres, and click on it. The player has one minute to click on as many highlighted spheres as possible.

This project is a team project: it should be done in teams of two. But individual submissions are allowed as well.

Starter Code

We recommend using this Oculus Minimal Example code from GitHub to start with. It's very compact but yet uses all of the API functions you will need.

To the minimum example you will need to add controller support, which this piece of sample code illustrates how it can be done. You can add this code to the draw() function of the minimal example to get printouts of the controller parameters. To see the cerr messages you have to display the terminal window, which you can do by replacing the line with WinMain with this one: int main(int argc, char** argv);

To better understand how the Oculus API works, we recommend this example from Oculus.

Project Description (100 Points)

Download the starter code and get it to work with the Oculus Rift. (10 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, Unreal, DirectX, etc). Here are step by step instructions for it:

  • Use a background color of your choice other than black for your application (5 points).
  • Load the the OBJ file of a sphere and display it at the user's dominant hand's controller position. This is the cursor. To load the sphere you can use the Assimp library. (10 points)
  • Create and render a 3D array of 5x5x5 = 125 spheres in a color of your choice. Each sphere should be the size of a tennis ball (0.07 meters diameter), and the balls' center points should be 0.14 meters apart from one another in all three dimensions. (10 points)
  • Wait for the user to pull the trigger button (index finger) to start the game. (10 points)
  • Create a way to change the color of a random sphere of the array to highlight it. (10 points)
  • Create the ability to move the cursor sphere to the highlighted sphere and upon trigger button click on the controller (index finger) test to see if the cursor is touching the highlighted sphere (a simple center-distance test will do). (15 points)
  • Once the highlighted sphere has been clicked on, move the highlight to a new randomly selected sphere. (10 points)
  • Repeat the above until one minute has passed since the game was started. (10 points)
  • Display the number of correctly clicked spheres in the terminal window (not in VR), and restart the game. (10 points)

Grading:

  • -3 points if spheres aren't 0.07 meters in diameter
  • -3 points if spheres aren't 0.14 meters apart from each other

Extra Credit (Max. 10 Points)

Options for extra credit are:

  • Avatar 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)
  • New game play: come up with a game that also involves clicking on things but is more fun than the homework project. (up to 10 points)
  • Instead of displaying text in the terminal window, display all text within the VR environment. You need to display at least the following things: a message to start the game, a countdown timer that shows the remaining seconds in the game, a message that the game is over along with the number of correctly clicked spheres. (5 points)
  • Support grabbing the set of spheres with the controller in the non-dominant hand: pressing and holding a button on the controller anywhere in space grabs the entire set of spheres as if they're all invisibly connected rigidly to the user's hand. They cannot snap to the hand but have to stay put when the user presses the button. While the user holds the button down, the spheres need to both translate and rotate with the controller. Once the button is released the movement of the spheres stops. (5 points)
  • Instead of (or in addition to) highlighting the sphere that is to be clicked on, wrap a picture of Waldo around it as a texture. (5 points)