Assignment 1: Scene Graph

CMSC 491G/691G, Fall 2007

Due Tuesday, September 18, 2007 (before class)


Create an artillery target shooting game using OpenSceneGraph (OSG). The playing field should be a flat plane with a target object randomly placed on the plane. You should render from the player's point of view, allowing them to move their gun up and down, left and right, in order to aim their projectile. Each shot should follow a parabolic arc and land somewhere on the plane according to the laws of physics. Their score is the number of shots before they hit close enough to the target.

You will need to:

  1. Choose a machine to use. OpenSceneGraph runs on Windows, Mac and Linux. You will need C++ development tools on this machine. Since you may need to install some software, this should not be one of the OIT campus machines. If this is a problem, see me, and I can get you access to a machine with the appropriate permissions and/or software.
  2. Download OSG from and (if necessary) build it. Allow a little time for this, as, depending on the existing setup on your machine, you may need to find and download some additional libraries as well.
  3. OpenSceneGraph includes many demo examples. Look through these for examples of the code you will need!
  4. Construct a small scene graph including plane, target and gun. For models, look at existing files or built-in simple shapes (e.g. a single cylinder would make a fine gun).
  5. Place your view above the plane behind the gun.
  6. Create controls to rotate the gun.
  7. Animate the projectile by looping through parabolic trajectory until you cross the plane.
  8. Figure out if they hit or missed by position 2D position on the plane.

691G students

Your project should include additional humorous models (balloon or pie projectiles?), reactions when objects hit or miss, or other extra features above and beyond the base assignment. Unless you are a modeling whiz, you will want to find free models online. OSG can load models in many popular formats.

What to turn in

You will submit your work to a cvs repository on the systems. Submit your project source only. I do not want your intermediate build files, executables, copies of OSG, or other stuff I can get or build myself. Do include necessary texture or model files. I recommend checking in working or partially working files early and often.

Check in a readme.txt file telling me what external sources and what OSG sample applications you used, what you did for your assignment, and what I should notice. Check in all of your source code files, and anything else that cannot be regenerated from them, including any external textures or models. Do not include any compiled object files, libraries or executables. They won't do me any good, and can lead to strange hard to find bugs when compiled code not corresponding to your current source is resurrected from the repository. Do not package all of your files up into a single archive. CVS has limited ability to deal with binary files, and you'll quickly end up using more space than you think you're saving.

If you need your quota increased (now, or at any time during the semester), let me know.

External help

I am expecting you will need make heavy use of web resources and sample code for this assignment. Such use is explicitly allowed for this assignment, provided you document your sources.


You will most likely run out of time. Plan accordingly, both to start early and to have something working by the deadline. Unless you already have a working setup, it will take much more time than you think to get any necessary software to work on your machine, even before you start coding. I added an extra weekend to the assignment for a reason. USE IT!