Interactive Media & Game Development
Worcester Polytechnic Institute

IMGD


IMGD-3xxx: HCI for Real, Virtual, and Teleoperated Environments
Project 3
Due: Friday, September 17, 2010 at 11:59pm

Objective: THIS PROJECT SHOULD BE DONE INDIVIDUALLY OR IN GROUPS OF TWO!

In this project, you will create a novel 3D input device, and have it communicate with the same game used in Project 2.


Where to get parts If you need common components, you can go to the ECE shop in Atwater-Kent, Room 112. They have lots of small parts, such as all kinds of resistors, capacitors, etc. They know you are coming. You will need to pay them (cash) for the parts you need. Also, there are links at the bottom of the course Web page to other sources of parts.

What to do: The project objective is to help you understand the basic activities involved in creating a new electronic device. For this you are going to build an input device with 3 dgrees-of-freedom (DOF) and use it as input for the space ship game used in project 2. This new device should replace the keyboard arrow keys. You can use the code from project 2 as a starting point.
  1. Part 1: Building the Device

    The first part of this project consists in building the input device to use in your game. To do that, follow the steps of this Instructable on-line tutorial.

    If you have access to a soldering iron, you can use that to do the necessary soldering. If you don't have access to a soldering iron, you can either use one from the good folks in ECE, or come by during Paulo's office hours. Students should show up at FL-B16 with their materials in hand and ready for the soldering process. Insulation tape for protecting your circuitry will also be provided during office hours.

    The materials needed for this part is listed below, but can also be found in the the Instructables on-line tutorial:

    1. 3 x 270k Ohm resistors
    2. 3 x 10k Ohm resistors
    3. Solder (provided in the lab)
    4. Shielded and unshielded wire (provided in the lab)
    5. Aluminum foil
    6. Cardboard

    Optional materials:

    1. Tape
    2. Insulating tape (provided in the lab)
    3. 3 x alligator clips
    4. 3-pin header (connector)
    5. Zip-tie
    6. Shrink wrap tubing, hot glue

    NOTE: Here is a more-detailed wiring schematic that might help you understand the Instructable better.

    When you are done building your device, you can test it by using the code provided in step 7 of the tutorial, specifically the code in the "Interface3D" folder. Testing can be done simply by checking Arduino's output using its serial port monitoring application. In case you get strange values as output, try changing the serial port baud rate from 115200 to 9600. The correct output from Arduino should be a series of with three values on lines similar to the ones presented below:

    
    5367 5625 5379
    5367 5623 5384
    5368 5621 5379
      	.
    	.
    	.
            

    Varying the proximity of your hand to each of the aluminum panels should make the values vary accordingly. Once you have tested your device with the code example, it will be time to integrate it to your game.

  2. Part 2: Move the Ship
    In this part, you will use the device you built to activate the thrust of the spaceship and direct it to left or right in the same way as you did in Project 2. Instead of using the button and potentiometer, however, you are going to use two of the input axes of your device to control the spaceship. It could be any pair ot the three, but try to make the player's life easier by making the control intuitive.

    • Calibration: Calibration is essential to the correct mapping of the input values received from your device. The calibration process consists of collecting the maximum and minimum values for each surface as you move your hand around the space within the aluminum faces without touching them. If you touch a face, the values output for that face are going to increase drastically and bias the minimum and maximum values that define the range of values the device can actually assume for that face. In addition, make sure your code handles values that are both above and below the minimum and maximum values that you obtained during hte calibration process. You can see in the "tic-tac-toe" code from the tutorial where this calibration is done.

    • Remmaping the Values: The input values for each axis vary with the square of the inverse of the distance between your hand and the corresponding aluminum plates. Hence, the values need to be linearized (non-quadratic) so that input values become more useful. For that you will have to use the other half of the code provided in the tutorial, located in the folder "TicTacToe3D". In particular, check the file "Normalize.pde" where most of the code you are going to need should be.

    Remember, when integrating the code, try to do it in small steps. Do not start integrating your device to Unity until you are sure the values you are receiving from the device are being mapped and transmitted correctly. In other words, do all your testing simply using Arduino's serial monitor unitl you get the output values you will need as input to your Unity code.

    Since this part of the project is just about coding, no extra materials are needed.

    Extra points: Use the third input axis to change some other feature in the game, perhaps the height of the spacehip in relation to the sea surface or even its color.


Attacking
the Problem:

This project is more complex than the previous ones, so it is important to work iteratively.
First get the device built, and have the Arduino spit out the values as described above.
To debug the hardware, make sure the metal from the three panels are not in contact with each other, and double check that none of the wires/resistors/etc. are touching anything they are not supposed to.
In general, the closer your hand is to one of the surfaces, the higher the value for that surface should be. Also, remember that the change in values will not be linear, but will follow the inverse-square law, so you will have to map the values accordingly. The code from the "tic-tac-toe" game from the tutorial shows you how to do this, but it is not very well commented.

If you are working in a team, you can choose to use the code from Project 2 from either member, or combine some code from each of you.

When trying to understand the Processing code from the "tic-tac-toe" game, you may find this detailed language description useful.


What to Submit: All documents are to be submitted electronically via turnin by 11:59 pm on the day the assignment is due.

The following items should be submitted for this project:

  1. The code for the project
  2. The schematics for the project
  3. Photographs of your device and Arduino circuit (you can get a digital camera from the ATC for this)
  4. A video of your project working would go a long way towards showing that it works (and will give you a YouTube video!)
  5. A brief description of any work you did to earn you extra points
  6. A brief report on problems encountered during the implementation of the project and what approaches were used as final solutions.
    Also, if you worked in a team, please provide a brief descriprion of what each person did.
Name each file something that makes sense.

When you are ready to submit, zip up all your files into a single archive file.
If there are two of you working on the project together, name the file LastnameFirstname1_LastnameFirstname2_proj3.zip, with the names of each of you. Only one submission per team is necessary.
If you are working alone, name the file LastnameFirstname_proj3.zip.

You will use the new Web-based "Turnin" facility to submit your work. Information about submitting can be found here:

http://web.cs.wpi.edu/~kfisler/turnin.html.

Your WPI user ID should be used to login, and you should have been emailed a password.
The Turnin assignment ID is proj3.


Academic
Honesty:
Remember the policy on Academic Honesty: You may discuss the project with others, but you are to do your own work. The official WPI statement for Academic Honesty can be accessed HERE.


Back to course page.