Assignment 1: Scene Graph

CMSC 491/691, Spring 2012

Due Tuesday, February 21, 2012

Assignment

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. The player should be able to move their gun up, down, left and right 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 hits.

You will need to:

  1. Since the lab machines will not be ready to use at the beginning of this project, first 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 openscenegraph.org 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. If you have any troubles, google is your friend!
  3. OpenSceneGraph includes many demo examples. Look through these for examples of the code you will need! The OpenSceneGraph-provided examples are all acceptable outside code for this project.
  4. Construct a small scene graph including a flat 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 so you can see the target and the gun (I suggest above the plane, behind the gun, but you can decide).
  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 2D position on the plane.

691 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 your class bitbucket repository. 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 doing a pull/update of the directory, locally checking in working or partially working files early and , then pushing the final release to bitbucket when you're ready. You can push to bitbucket many times if you want — I'll grade the final verison.

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.

Tips

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.

Objective

The first thing I hope you get out of this assignment is a working sandbox environment for future development. OpenSceneGraph is has some characteristics of a game engine, but only does rendering. Plus, it is cross platform, open source, and has a ton of image and model format loaders already included.

The second thing I hope you get out of this assignment is some understanding and experience in developing a quick prototype. It's not expected to be complete or have complex art assets. It should just be a mock-up of this one gameplay element. This is the reason for the extremely short time: place a plane, cylinder, sphere, and target, a couple of controls and a simple parabolic path. There is no time to do anything more complicated or complete.