Project4W21
Contents |
Homework Assignment 4: Building Blocks
Prerequisites:
- Windows or Mac PC
- Unity
- GitHub Repo (accept from GitHub Classroom link)
- VR headset with two 3D-tracked controllers, such as the Oculus Quest 2, Rift (S), Vive, etc.
Learning objectives:
- 3D menu interaction
- Radial and rectangular menus
- Hand-centered menus
- Room-centered menus
- Menu widgets: buttons, sliders, dials
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 3D application to create building blocks of different shapes and colors and allow the user to play with them.
All interaction (except otherwise noted) has to be done with the VR system (headset and controllers). The user is not allowed to use keyboard or mouse.
Our TA Robin Xu created a demo video for this project.
This project was inspired by the following things:
- A Wood Blocks childrens' toy:
Concept
Create an application to allow the user to spawn 3D building blocks with a 3D menu and build structures with the blocks. Gravity should be part of your application. The user is assumed to be in a seated position when the application starts, as well as throughout the application.
Implement the following features:
- A radial menu to select the type of block to create.
- A stationary menu on the desk to change color and size of an object, as well as control gravity.
- The ability to move the blocks around with the controller, including putting them on top of one another.
Components (100 Points)
- Create a large rectangle to serve as a table surface to put the building blocks on. Place it at the height of a typical desk and right in front of the user in the VR space.
- Use the Virtual Hand interaction method for all interactions with the application. You can re-use the one from project 3.
Radial Menu (40 Points)
- Create a radial menu which is about 20cm wide. It should have entries for the four different shapes the user can create: cubes, cuboids, spheres and cylinders. Create icons for the four different shape types. You can copy images from the internet, or take screenshots of the objects you're creating. Show the icons in the four quadrants of the radial menu. (10 Points)
- The menu should show up near the user's non-dominant hand (and move with that hand) when the user twists their wrist so that the palm faces towards the user. It should be hidden otherwise. Tune your parameters for showing the menu so that it shows up reliably when you want it to and won't when you don't. (10 Points)
- When the user's dominant hand's controller is over one of the four menu items the item should be highlighted before the user clicks on it. Use a highlighting method of your choice. (10 Points)
- When the user clicks the dominant hand's trigger on one of the four menu items, create a new 3D shape and show it in the user's dominant hand. It should be colored white or grey. All 3D shapes are part of Unity's built-in 3D object types or can be derived from them. By default the objects should be at least 10cm wide. (10 Points)
Here is a sketch of the radial menu:
The icons for the four shape types should be 2D images, not 3D models.
Stationary Menu (45 Points)
Create a rectangular stationary menu and place it on the table in front of the user (or off to the side of the user's dominant hand). This menu should always be visible. Its overall size should be similar to a typical computer keyboard (~30-40cm).
This menu should have the following widgets:
- Four buttons to change the selected object's color to red, green, blue or yellow. The buttons can be round or rectangular. To change the color, the user should put their controller on the respective color button and pull the trigger. (15 Points)
- A dial to change the size of the selected block (all three dimensions equally). To interact with the dial, the user should click on it with the dominant hand's controller, hold the button down, and rotate the dial by only parsing the rotation of the controller around the forward axis of it. The dial in the menu should visibly rotate along with the controller's rotation, and the selected block's size should change as the user rotates the dial. (15 Points)
- A slider to change the amount of gravitational force (affecting all blocks equally): when centered it should be what we are used to on Earth, but you should be able to reduce or increase this force to 1/10th or 10x (respectively) with the slider. To interact with the slider, the user has to move their hand to the slider knob, hold down the trigger, and move the knob while the trigger is held. The knob should only respond to the horizontal component of the controller's movement. (15 Points)
All widgets on this menu should be actual 3D objects.
Here is a sketch of what this menu could look like:
Other Requirements (15 Points)
- The user has to be able to grab any object by moving their controller to it and holding the trigger button, and moving it to a new location where they release the trigger. At that point the object should fall with gravity and tumble over other objects to the table surface as it would in reality. (5 points)
- Grabbing an object and hitting other objects with it should whack them similarly to what would happen in reality. (5 points)
- The most recently selected block should be highlighted with a method of your choice, for instance the same as in project 3. This highlighted block should be the one that is affected by the color and size changes in the stationary menu. Your highlighting method should not affect the size or color of the block. (5 points)
Notes:
- You do not need to implement any travel method for the user. But all 3D components of the software should be set up so that they can be comfortably reached from a seated position.
- The only button you are allowed to use is the trigger on the dominant hand's controller. You are not allowed to use the joysticks on the controllers.
- Throwing of objects with a physically correct trajectory is not required. It is sufficient to drop them when the trigger is released, regardless of the controller's motion vector.
- To change the state of which object is selected, you can decide if the user needs to grab the object, or just intersect it with the controller. The latter may be easier to implement.
- Once a new object is selected, dial and slider can go back to their default states, rather than reflect the new object's values, if that is easier to implement.
Extra Credit (10 Points)
You can choose between the following options for a maximum of 10 points of extra credit.
- Add sound effects to your application for any clicks in menus. Use different click sounds for the radial menu and the stationary menu. Also use sounds that you adjust the pitch of for the dial and the slider. (5 points)
- Create a color picker to allow the selection of any RGB color. Feel free to draw inspiration from paint programs. (5 points) Example:
- Add a way to delete 3D objects from the scene with this gesture based approach: when the user grabs an object and throws/drops it behind them it gets deleted. This can be done by defining a hemisphere behind the user where the object gets deleted when the trigger button is released. (5 points)
Submission Instructions
Once you are done implementing the project, record a video demonstrating all the functionality you have implemented by using the menu to create various building blocks, place them on the table or on other blocks, and change sizes and gravity.
The video should be no longer than 5 minutes, and can be substantially shorter. The video format should ideally be MP4, but any other format the graders can view will also work.
While recording the video, record your voice explaining what aspects of the project requirements are covered. Record the video off the screen while you are wearing the VR headset.
To create the video you don't need to use video editing software.
- 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.
Components of your submission:
- Video: Upload the video at the Assignment link on Canvas. Also add a text comment stating which functionality you have or have not implemented and what extra credit you have implemented. If you couldn't implement something in its entirety, please state which parts you did implement and expect to get points for.
- Example 1: I've done the base project with no issues. No extra credit.
- Example 2: Everything works except an issue with x: I couldn't get y to work properly.
- Example 3: Sections 1, 2 and 4 are fully implemented.
- Example 4: The base project is complete and I did z for extra credit.
- Executable: Build your Unity project into an Android .apk, Windows .exe file or the Mac equivalent and upload it to Canvas as zip file.
- Source code: Upload your Unity project to GitHub: either use the Unity repository initialized from GitHub Classroom or any GitHub repository that you might set up on your own. Make sure you use the .gitignore file for Unity that is included in the repo so that only project sources are uploaded (the .gitignore file goes in the root folder of your project). Then submit the GitHub link to Gradescope by using 'Submission Method: GitHub', along with your Repository link and the respective GitHub branch. (Note: GitHub Classroom is only for starter code distribution, not for grading. Since we don't have any starter code for HW1, you can set up your own repo with Unity .gitignore file we provided and submit to Gradescope too.)
In Summary, submit to Canvas with 1. Video and 2. Zipped Executable files (.exe, .dll, .apk, etc.), and submit to Gradescope with 3. Source Code.