Project4W16

From Immersive Visualization Lab Wiki
Jump to: navigation, search

Contents

Jenga

This project is designed for use with either the Razer Hydra or the zSpace.

The Immersive Visualization Laboratory at the Qualcomm Institute has three Windows PCs with zSpaces available for the project. They will need to be shared between the groups that use them.

There will be a homework discussion on Wednesday Feb 17 at 1pm in WLH 220. Note that this time slot has moved from Monday due to the holiday.

Jenga is a popular game in which players take turns removing one block at a time from a tower constructed of 54 blocks. Each block removed is then balanced on top of the tower, creating a progressively taller but less stable structure. The player who successfully removes and places the last block wins.

In this project, you are allowed to use only one button on each controller of the Hydra, or one button of the zSpace stylus. You are not allowed to use the thumb stick on the Hydra, or any other input devices, such as keyboard or mouse.

Jenga-start.jpg Jenga-midgame.jpg
Starting configuration Mid-game configuration

Devices

Razer Hydra

To use the Hydra in Windows, you will need to first download and install the driver.

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 download it by its direct URL, which depends on your OS:

Getting the Hydra to work on a Mac seems a bit hacky. We hope you'll manage to do it anyways. The course staff will try to help you.

If you use Unity you will need the Unity plugin for the Hydra. For instructions on how to get the Unity plugin to work look here.

zSpace

The zSpace drivers and the SDK are already installed on the zSpace developer workstations, along with Visual Studio and Unity. We also already installed this Unity plugin on the zSpace PCs.

Note that in order to run Unity with full 3D support for the zSpace you need to run it from the command line with the following parameters:

Unity.exe -force-opengl -enable-stereoscopic3d

Menu System (30 Points)

Before the Game (15 Points)

When the user starts up the game, there should be a menu with the following options (you are allowed to add more if you wish):

  • Selection of the number of players: one or two. In two player mode, during the game there should be an indicator for which player's turn it is. The two players should share the input device and may have to take turns sitting in front of the game. Since this is not particularly convenient, there will be a network option as part of the extra credit.
  • Setting the height of the tower in increments of one, between 2 and 50. The height of the tower is the number of layers of blocks. The default should be 18. Regardless of the number of layers the player chooses, there should be three blocks per layer.
  • A Quit button to end the game and go back to Windows.

During the Game (15 Points)

At a minimum, you need to implement functionality, to be accessible at any point during the game:

  • Reset the tower to its initial configuration.
  • Return to the main menu.
  • Undo the last block removal (no need to undo more than one step).
  • Replay the last removal of a block.

At the end of the game once the tower has fallen, this menu should still be displayed, along with an indicator of which player won if two player mode was used.

Jenga Game (70 Points)

Based on information in a research paper from Carnegie Mellon University the Jenga blocks are (on average) 8.1cm long, 2.6 cm wide, and 1.8 cm tall, and they weigh 19.6 grams. The static friction coefficient they give is μ=0.4. You will need to implement a Jenga block with these parameters, including its physical properties.

You need to texture the bricks with a wood texture of your choosing, to make them look realistic.

Then you will need to build the tower in its initial configuration (see picture above). Note that you should introduce tiny amounts of randomness for each block's placement, to make the game playable and fun.

For this homework project, we simplify the game a little bit, in that we don't require that the player put the blocks back on top of the tower.

At the heart of the game are the players' turns in which they have to remove one block at a time. You don't need to distinguish between multiple players - just allow the user to remove a block at a time. How exactly you do the user interaction is up to you.

You will get points for the following things, each is worth 10 points:

  • Initial tower construction with textured blocks.
  • Application of physics parameters and fine tuning.
  • You have to use objects with physical properties to remove the blocks - for example you might attach a rigid stick to the controller, with which the user can push a block out of the stack.
  • If you use the Hydra, you need to implement a way for the player to move the camera, so that the player can see and reach all blocks in the tower from either side. The zSpace users do not need to worry about this, but they need to worry about being able to use only one button instead.
  • Determine which player wins in two player mode.
  • Undo of last brick removal.
  • Replay of last brick removal.

Extra Credit (10 Points Maximum)

You can obtain up to 10 additional points if you do one or more of the following things:

  • Network play option for two player mode: each player sits at their own PC and they take turns playing, just like in a real Jenga game (10 points). The second player should either use one of the previously used devices (Kinect, Leap, Move) and can use a PC in the basement lab with it (drivers for Kinect and Leap should be installed, Move can be run as a regular user), or you can use one of the zSpaces, or ask the instructor to use an additional Hydra - but you won't be able to check it out, it'll be shared between all teams who need it.
  • Once a block has been removed, you require the player to put it on top of the tower (5 points).
  • Jenga gun, like in this video. (5 points)
  • You come up with a way to visualize the force the player is pulling with (for instance, a spring loaded stick to push, or you attach a spring to a block to pull on it) (10 points).
  • You offer the player visual aids to know which blocks are looser, which you can do by visualizing the static forces in the entire stack. OpenSees might work for this (10 points).
  • If you have other ideas, ask us!