IMGD 4000 (D 10)
Individual Homework Assignment #1
Due by Web Turn-In: Midnight, Friday, March 19
(See general homework instructions for turn-in details.)
The purpose of this assignment is to get you up to speed as quickly as possible with the software tools (jME, etc.) that you will need for the homework assignments and to shake down the homework submission process:
- Make sure that Java 1.6 (full development environment, not just JRE) is installed ("java -version"). Homework has been tested on Windows and MacOS (should work on Linux also, but not tested). If you are having trouble, make sure you are using the 32-bit (not the 64-bit) version of the JRE by setting the appopriate Java preferences.
- Download chess.zip (26MB) from the Course Materials section of the myWPI site for this course. This file contains:
- Java source, class and javadoc files for a simple text-based chess game in the package edu.wpi.imgd4000 (main class Match). This code will not be needed until the next homework.
- 3D models for a complete chess set (six black and six white pieces) in jME binary format (art by Jacob Lubinsky).
- Jar files and native libraries (Windows, MacOS and Linux) for runtime jME 2.0.
- The 'turnin' directory with examples of how to prepare your homework for web turn-in according to the instructions.
- If you are planning to use Eclipse (Galileo) for your homework (highly recommended), you may import chess.zip as an Eclipse project via: File > Import > General > Existing Projects > Next > Select Archive File > Browse > Open > Select All > Finish.
- Make sure you don't already have a project named chess.
- Do not select "Archive File" instead of "Existing Projects" under "General" above!
- To test your installation, right-click on Chess.java (in default package) and select Run As > Java Application. The display will eventually show a single chess piece against a black background (press 's' key to move camera back so you can see the whole piece).
- Special note for MacOS users: Due to an unfortunate library version interaction you need to remove the swt.jar and jme-swt.jar libraries from the chess project classpath via: Referenced Libraries > right click > Build Path > Remove.
- To start learning about jME:
- Study the introductory tutorials.
- Follow the instructions in README.txt to run the test example chooser.
- Register with the online forum. Mention that you are a WPI student in your first posting and, of course, be polite and respectful.
- Download jME 2.0 (45MB), which includes source and javadoc, from the Course Materials section of the myWPI site for this course. Unpack this zip file at a convenient location for reference to the source and javadoc. (Note that the javadoc on the jME site is not as up-to-date as this download.)
Your basic assignment is to create a chess board with moveable pieces, which will look roughly like the rendering below. Note that this assignment does not include providing controls to actually move the pieces (that's part of the next assignment).
The code you write for this homework will be the foundation for the three following assignments in the course, so write it carefully and clearly!
Please post any questions to the myWPI discussion board for the course.
- Create a standard 8x8 black and white chess board by correctly placing and coloring instances of com.jme.scene.shape.Quad.
- Hint: You need to call setLightCombineMode(LightState.OFF) on the board node to make the colors show.
- Place the chess pieces provided on the board. Make sure you follow the correct board layout, i.e., "white on right, queen on her color". See the Chess program in the unnamed package of the chess project for an example of how to correctly load models as resources, i.e., via the classpath.
- Hint: "White on right" means that, if you are looking at the board from a player's
perspective, the rightmost square in the first row is white. This means
that both players' right rook should be on a white square.
- (Re-) orient the board so that the players can easily see the position of all the pieces and will be able to pick his/her own pieces with the mouse (you don't need to actually implement the picking until the next assignment).
- Hint: Use Camera.setLocation() and Camera.lookAt()
- The main class for this homework should be called Chess in the unnamed package to facilitate turning it in according to the instructions.