Homework3W13
Contents |
Homework Assignment 3: Building Blocks
For this assignment you can obtain 100 points, plus up to 10 points for optional work.
The goal of this project is to create an application which uses the Razer Hydra to allow the user to build Geisel Library out of building blocks. The video on this web page might inspire you.
Razer Hydra
This homework assignment requires the use of a Razer Hydra input device. Every team/individual is going to get to borrow one from the instructor for the remaining weeks of the quarter. If you work as a team, please take only one.
The Hydras can be picked up from the instructor's office, Atkinson Hall room 2125. The office door should be open all day. If the instructor is not in the office, please sign one of the borrow agreements and leave it on my desk, then take a Hydra from one of the boxes on the floor.
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, which we have not tested, but it supposedly works.
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)
Your application needs to have the following features:
- There needs to be a ground plane (for instance, created with osg::InfinitePlane), or some other surface which doesn't have to be flat, to build on. (10 points)
- Unless you use the Hydra for it, the mouse should rotate the world with the ground plane and the bricks on it, but not any of your menu items. (10 points for rotation regardless of method)
- Allow the user to create at least 5 different shapes of blocks, for instance with the osg::Shape Class, which supports Cone, Box, Cylinder, Sphere. There should be models for all possible shapes on the screen to choose from, for instance in a column along the right edge of the screen. Make sure you choose blocks appropriate for the task of creating Geisel Library. (25 points)
- The Hydra wand need to each have a cursor. A cone-shaped cursor would work well, but any shape will be fine. If both Hydra wands are used, they need to have cursors in different colors. (10 points)
- Allow at least five different colors to be used for the blocks, all of which should be clearly distinguishable from one another, the background and the ground plane. Display color widgets on the screen, for instance along the top edge of the screen. The color widgets could be displayed as colored spheres, but any other shape would also work. Make sure that task-appropriate colors are among your colors, for instance grey for concrete, blue for windows, green for plants. (25 points)
- To place a block, the user should click a button on the Hydra's wand when the cursor is on a shape to select it and create a copy of it, which will attach to the cursor (and possibly replace it). Then, while the button is held down, the user moves the shape to the color widgets, and when the wand cursor gets close to one (distance origin-to-origin below a threshold) the block will assume that color. Finally, the block is placed on or above the ground plane by releasing the button. Wherever the block is put it will stay, even in mid-air. There is extra credit for physics simulations, see below. (10 points)
- Blocks are allowed to intersect each other, there needs to be no collision detection.
- The application should support both Hydra input devices. It is up to you to decide what each wand will be used for. (10 points)
- Only one button on each Hydra wand should be used for this application.
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. You are going to have to build a simple version of Geisel Library.
Extra Credit (10 Points)
You can achieve 10 points of extra credit in one of two ways:
- Add physics simulation to the behavior of the building blocks: when you drop one, it should not just fall until it hits another block or the ground plane, but it should bounce off other blocks and the ground plane until it comes to a stop, like a real building block would. You are welcome to use an open source Physics Engine, but it may be easier to implement your own very specialized physics engine for this task.
- Turn the blocks into Lego bricks. Put little cylinders on their top surfaces in regular grids like real Lego bricks, and make pieces snap to one another when they get close enough. If you put enough effort in it, you might be able to compete with Lego Digital Designer!