Comp 236, Final Project
This applet allows you to play a simple strategy game.
Here are the keys which fly you around the
board. This is in real 3D - there are no limits on your movement
whatsoever.
NOTE: You may have to click once on the applet panel before the keys will work.
(This tells Netscape to send the keys to the applet).
Features:
- New file format for specifying objects:
- First you specify a geometry for the object, with lists of
vertices and triangles. The vertices can have a color index, and the
triangles can have a texture index and (u,v) coordinates specified
for their vertices.
- Next you specify instances of the object. For each color and
texture index you specified in the geometry section, you list the
real texture or color corresponding to it.
- Finally, for each instance you can specify a scale and
translation to move that instance of the object into world
coordinates. (sorry, no rotation yet.)
- 2D interaction in 3D.
- If you click on one of the bases, it will highlight and report
it's population.
- If you click on a ship, you can drag it to a base, and at the
end of the turn (click the End Turn button) the ship will move to a
new base, fight the ship there, and someone will win. (Sorry, no
special effects).
- Texture mapping. Each object can have its own texture. Make sure
you fly up to the ships sitting next to the bases - each player has
their own textured ship.
- Lighting. The light is sitting on your head, and gets dimmer as things
get farther away. I have the ambient term set fairly high, though, so
you can always see all the objects on the screen.
Technical Details - i.e. my final report for
this project.
Fixed Bugs:
- Bugs, what bugs? I only add features!
Known Bugs:
- Clipping is still done by throwing away any point or triangle
which extend behind you, so parts of objects tend to disappear and reappear.
- You can walk through objects.
Source Code:
Here's a browsable directory.
Some of this code was borrowed from Leonard McMillan's code, which he has made available as
part of assignments for Comp 136. Part of the code was also adapted from example applets
provided by Sun with their JDK.
Our textbook explains all of the 3D techniques we are using in these assignments:
Foley, van Dam, Feiner, Hughes. Computer Graphics: Principles and Practice, 2nd Ed. in C,
Addison-Wesley, 1996.
Last modified: April 30, 1997. Aron Helser