Difference between revisions of "Homework2W14"
(→Homework Assignment 3: Packing 3D Tetris Blocks) |
(→Homework Assignment 3: Packing 3D Tetris Blocks) |
||
Line 10: | Line 10: | ||
[http://www.searchamateur.com/pictures/tetris-cube-1.jpg] | [http://www.searchamateur.com/pictures/tetris-cube-1.jpg] | ||
− | [Media:http://hulkhandsome.com/wp-content/uploads/hulkhandsome.com/2010/07/11072010498.jpg] | + | [[Media:http://hulkhandsome.com/wp-content/uploads/hulkhandsome.com/2010/07/11072010498.jpg]] |
− | [Media:http://hulkhandsome.com/wp-content/uploads/hulkhandsome.com/2010/07/11072010497.jpg] | + | [[Media:http://hulkhandsome.com/wp-content/uploads/hulkhandsome.com/2010/07/11072010497.jpg]] |
==Razer Hydra== | ==Razer Hydra== |
Revision as of 02:45, 25 January 2014
Contents |
Homework Assignment 3: Packing 3D Tetris Blocks
For this assignment you can obtain 100 points, plus up to 10 points for extra credit.
This homework assignment is due on February 7th, 2014 at 1:30pm. Matteo is going to do a Q&A session on Wednesday, January 29th at 4pm in the computer lab.
The goal of this project is to create an application which uses the Razer Hydra to allow the user to pack a number of 3D tetris blocks as tightly as possible. Feel free to get inspiration from the image below, but know that the tetris blocks in it do not match those used in this project: [1]
In this project, only the following tetris blocks are valid:
[2] Media:http://hulkhandsome.com/wp-content/uploads/hulkhandsome.com/2010/07/11072010498.jpg Media:http://hulkhandsome.com/wp-content/uploads/hulkhandsome.com/2010/07/11072010497.jpg
Razer Hydra
This homework assignment requires the use of a Razer Hydra input device. Every team is going to get to borrow one from the instructor until the end of the quarter.
To use the Hydra, you will need to first download the driver. If you use the lab computers the driver is already installed.
If the above driver doesn't work on your computer, you could try version 1.00.
There is even an open-source Linux driver for the Hydra.
The Hydra SDK can be downloaded through Steam, but it's much easier to just download it by its direct URL, which, thanks to Thinh and Arick is listed below for various operating systems:
Application (100 Points)
You need to write an application, which allows the user to tightly pack a number of 3D tetris blocks (the possible brick configurations are shown below).
Initially, all blocks are randomly distributed about the 3D space on the screen. The computer automatically calculates an axis-aligned, square bounding box around these blocks, and keeps it updated throughout the runtime of the application. The user should be able to grab and shift/rotate the world with one hand, and grab and move individual Tetris pieces with the other. The goal is to arrange the Tetris pieces in as tightly packed a cube as possible, so that the bounding box can shrink to as small a size as possible. There should be a timer to give the user 2 minutes for this task. The size of the bounding box at the end of the two minutes is the score. Lower scores are better.
Your application needs to have the following features:
- Create at least two instances of each type of 3D Tetris block.
- Give each type of block a different color. If two blocks have the same exact shape, they should have the same color.
- Initially, all Tetris pieces need to get randomly distributed around the world.
- One of the Hydra controllers should be used to grab the world. The world includes all Tetris bricks, as well as the bounding box around them.
- The other Hydra controller should be used to select Tetris bricks and move them around the world. They should always remain axis-parallel and snap to an imaginary grid with a granularity of one box of the 4-box Tetris pieces.
- You need to implement a way to rotate the Tetris bricks.
- You need to implement simple collision detection to prevent the Tetris pieces from going through others.
- Update the bounding box every rendered frame. Show its size (length of one edge in atomic tetris block units) on the screen.
- Implement a counter which counts down from 2 minutes to zero.
- Implement a function to reset the game (randomly redistribute the blocks) and the countdown timer.
Grading
On the due date, you will need to demonstrate your application with a Razer Hydra in the lab on a lab computer or your own laptop.
Extra Credit (10 Points)
TBD