assignments-constructionsite

CS559 Construction Site Project

This is a new project for 2008, so bear with us as we work the kinds out.

Please check back often for updates! If there’s something that you don’t understand or want clarified, please email the TA and instructor - probably others are asking the same question!

Updates:
10/8 - Updated the framework code. The following files were affected: SiteDisplay.cpp, SiteDisplay.h, ConstructionSiteWindow.cpp, Utilities/ArcBallCam.h and Utilities/ArcBallCam.cpp

10/6 - Added various hints and tips, and make the assignment not “preliminary”.

10/5 - added links to the excavator page

Project Due: Tuesday, October 21st

Reminders for next year:

  • Explicitly disallow using glLoadMatrix to do end effector positioning (turns out that its difficult to get right anyway, and few students tried successfully).
  • Explicitly state that normals and appearance matter.

1.@ Introduction

As you’ve probably noticed, there’s a big hole in the ground (construction site) across the street from the CS building (this building will be the new “Wisconsin Institutes for Discovery”). Soon, there will also be a construction site since they are re-building Union South.

Watching construction - especially with heavy equipment - is pretty fun. Wanting to watch big construction machines work seems to be genetic (as a father of a 3 year old, I can confirm this). Although some people might lose their fascination with construction equipment as they grow up, many of us have been surprised how fun (distracting?) it is to watch what’s going on across the street. That is, those of us with windows in our offices facing the right direction.

Unfortunately, our poor TA has a windowless office, and is missing out on watching the machines do their work. So the purpose of this assignment is to simulate the big machines with computer graphics, so he can get his construction equipment fix. (note: The more obvious solution, take pictures/video of the construction, is being done. But making using of these images is for a different class.)

So, your mission in this assignment is to make a 3D simulation of some construction equipment. Fortunately, many types of construction equipment are great examples of hierarchical transformations (articulated figures), so this will be a great opportunity to practice this critical part of the graphics class.

1.1@ Objectives

Understanding the “real” goals of this assignment will help you realize what is (and isn’t important):

  1. To practice designing things with hierarchical transformations, and using hierarchical transformations.
  2. To experience trying to make things out of polygons, including getting the normals right.
  3. To get some practice working inside of someone else’s interactive system.

This last part is of some degree of importance: we will provide you with a bunch of code to make a 3D user interface, so you can focus your energy on making construction equipment. If you don’t use our code, this assignment will be a lot more work. You may not like our code, but think of it as practice for the real world, where you are often forced to make use of an existing code.

Note that many of the things we’re discussing later in this class are not part of the assignment. For example:

  1. We’re not doing curve and surface models (yet) - so you’ll model everything with polygons. (yes, they will look blocky)
  2. We’re not doing texture mapping (yet) - so you won’t be able to put fancy colorings (like words and logos) onto the construction equipment.
  3. We’re not doing physical simulation - so you won’t have to model how the dirt is moved around by the various machines.

2.@ Construction Equipment

Here are the kinds of equipment in use at the WID site:

  • Tower Crane
  • Truck Crane
  • Telescoping Truck Crane
  • Excavator
  • Mini-Loader
  • Fork-Lift
  • Fork-Lift Crane

And some that I’ve seen there (but not today):

  • Bulldozer
  • Front-End Loader
  • Dump Truck
  • Cement Mixer
  • Back-hoe

Coming soon: we’ll have galleries of pictures of each of these.

If you notice, for each of these, the main function consists of a number of pieces that move with rotation/translation with respect to one another. Many involve just rotation (e.g. excavator, bulldozer, dump truck), others have some translation involved (cranes).

The main portion of this assignment is to make a few of these pieces of construction equipment. You need to make them such that each of the main pieces is separate so you can change the “parameters” of the transformations and make the machine move.

For example, consider the dump truck. Like all pieces of equipment it has 3 parameters that are its position in the work (x,y on the ground plane, and theta - its orientation on the ground plane). But it also has another parameter - the angle of the “dump”.

That main thing you do for this assignment is to create the functions that implement the various pieces of construction equipment (including drawing them).

2.1@ If you really don’t like construction…

In the event that your inner 3 year old isn’t excited by this, there are other “machines” that can also be modeled / simulated as a number of pieces moving relative to one another. Many amusement park rides (ferris wheels, merry-go-rounds, tilt-a-whirls, …) fall into this category, and if you want, you can make some of those. Note that “track rides” (like roller coasters) are quite a different thing, and will be the subject of another assignment.

We want to let you be creative in what you choose to model, but remember, our goal here is to have you learn about modeling with transformation hierarchies. So having something that moves in a “creative” way, is only valuable if it moves in the way its supposed to. (not “i meant for it to do that”).

Also, not all of the things construction equipment can do (like place rocks) make sense for other things. Make sure you have enough equipment to show off the features.

3.@ The Construction Site (and code framework)

The pieces of construction equipment need a construction site to work in. More practically, this is the program that puts up a window, provides lighting and a camera UI, provides an interface to each piece of equipment, etc.

We will provide you with an (admittedly simple) framework for doing the project. It will define an “abstract base class” for “Machines” (pieces of construction equipment). Your main task for this project is to define subclasses for different types of machines. You’ll also need to edit the setup portion of the program to have it put the Machines into the construction site.

The example code is intentionally very simple. You can clean it up, provide a spiffier interface, add features, etc. You can even re-write it from scratch if you’re really ambitious (warning: this will be a lot of work, and you’ll need to make sure you provide all the functionality). However, this is not the focus of the assignment. The main thing your grade is based on is how well you implement the various machines.

4.@ What machines need to be able to do

To work in the simulation, machines need to:

  1. Set themselves up in a way that allows the framework code to work with them. (this involves a constructor that sets a number of variables)
  2. Draw themselves (given their parameters)
  3. Set the viewpoint to provide a nice view of the machine
  4. Set the viewpoint to look out the driver’s seat (note: not all things can do this)
  5. Determine where the “end-effector” of the machine is. For example, the bucket of an excavator, or the gripper of a crane. (this doesn’t make sense for all pieces of equipment). This will be used to “place rocks”.

At a minimum, a machine needs to do 1-3. 4 and 5 only make sense for some machines (those that drive and those that can pick things up). You’ll need to make at least one machine that does everything (an excavator).

There is a virtual base class for Machine that provides methods for each of these. To make a new kind of machine, all you need to do create a subclass of Machine and override the appropriate methods. You’ll also need to modify the main function of the program in order to put an instance of the machine into the construction site, so we can see it work.

A Caveat on setting the view in general…
Be sure to clear and set both transformation stacks. Look at the ExampleMachine for an example.

A Caveat on Driver’s view:
If you put the viewpoint inside of the machine, you might be looking at the walls of it! You might consider setting the near clipping plane so that the machine can see outside, or to move the position in front of the windshield.

A Caveat on Lighting:
The sample code uses lighting. This means that you need to set normal vectors properly. Alternatively, you can turn off lighting and color each polygon seperately.

A Caveat on Controls:
The simple UI (sliders for all the parameters) isn’t so convenient. It lets you change the parameter values, but its limited to (at most) 10 parameters, and isn’t so useful for making coordinated changes to sliders (changing more than one thing at once). It was designed to be general, and easy to implement, not necessarily easy to use. Improving the UI is something you might want to consider doing.

5.@ Assignment requirements

At a minimum you must:

  • Create at least 3 new types of machines that support the minimum functionality
  • At least one of them must be an excavator, which has (at least) the following parameters: X,Z, (Theta - orientation of the base), Spin (rotation of the upper part), arm lift angle, “elbow” angle, and bucket angle. The excavator page will tell you more about excavators. The excavator must support the driver’s view and compute the end effector position.

The sample executable meets this requirement. With an amazingly small amount of code.

To go beyond the minimums you can:

  • Make more than 3 different types of machines. The best is if you show off different types of articulations.
  • Make the machines geometry be nicer. (yes, you can make things out of cubes, but hopefully things will be nicer - unless you try for a “realistic lego look”)
  • Add extra functioning things to the geometry (like the hydraulic pistons on the excavator).
  • Do something creative that we haven’t thought of. (Note: you should probably ask before spending a lot of time on something. For this assignment, things should focus on the goals of the assignment - we’ll have time later to explore topics like appearance and texture, curved surfaces, …). Some things you might want to add (like nicer interfaces for driving and animation) will require are a little tricky given how the framework is created.
  • Improve the UI - unfortunately, this will require making changes to the framework code. But, if you want to try to implement better ways to control the machines than sliders, let us know, and we’ll help you figure out how to adapt the framework code.

Note: it is more important to have machines with the correct behavior than it is to have them look really nice. If you really want to write a model loader (or find one on the web and incorporate it into your program), and either model things yourself or find models on the web, that’s fine (providing you give proper attribution). However, its a lot of work, and you still will need to figure out how to have the models have the pieces move correctly (which can be harder than making things from scratch).If you have no idea what a model loader is, don’t worry about it.

6.@ Caveats on the Code

The framework code that you will be using is somewhat simple. It was designed for a minimum of dependencies on other things, and to make it as easy as possible to do the basic aspects of the assignment. This means some unusual design choices were made (for example, there is no 3D point class or math library used), and the interface is a bit overly-simplified.

The framework code may evolve over the course of the project. We might fix bugs, or add interface improvements. We will provide updated code as its available. To make it easier to get updates, we recommend:

  1. Most of your work should be in seperate files (defining new classes), except for a few lines added to the main function
  2. If you find a bug in the framework code, tell us so we can update it for everyone
  3. If you make changes/improvements to the framework code, make sure its clearly marked. This is important for you (so you can move these changes to new versions), but also it will be useful for us (so we can incorporate improvements for future projects).
  4. Avoid making changes to the existing code that aren’t essential. For example, if you don’t like the style of the code, or the way that a particular thing is done, don’t make a change that doesn’t improve the functionality. (basically, if it isn’t broken, don’t fix it)

The camera control code was given in previous years, you can find the sample code discussed on Last Year’s Sample Code Page. You might also want to look at last year’s Tutorials for examples of how OpenGL and FlTk work together.

There is a substantial chance we will update how the camera code works, so you might not want to rely on its internals too much. Also, the code can be hard to understand because it uses some tricky concepts (quaternions) inside. Hopefully all the internals are hidden from you.

The one thing you probably do want to know about the camera: use the right mouse button. If you hold the ALT key, you’ll pan instead of rotate. It only looks for the ALT key when you first press the mouse button.

7.@ What you will turn in

You will need to turn in everything that is required to build your project (including the framework code). This includes the visual studio solution and project files. As usual, do not turn in binary files or debugger information.

Be sure to turn in a README file that describes your project. It should list all of the changes you’ve made to the example code.

In the README, be sure to:

  • List all the machines you added, including a list of the parameters they have.
  • List any other changes you made to the code. (besides adding the new machines to main)

Also, include screen shots (in .png or .jpg format) that include pictures of each type of machine you’ve created.

8.@ What we will give you

We will provide you with the framework code. We’ll make it available as a ZIP file, but we will also provide a CVS archive (for those of you who know that that is) so you can get updates more easily.

We will provide the executable of an example solution. It will have a bunch of sample machines for you to experiment with in order to see the kinds of things we expect.

There is a sample executable that meets the minimum requirements. It has an excavator, a (very simple) dump truck, and a crane.

9.@ Deadlines

The project is due on Tuesday, October 21st. (any time)

Late projects will be accepted according to the course late policy. (A late project may be turned in until Friday, October 24th, and a very late project until sometime around the following week).

10.@ A Closing Note

Several (at least 4) former 559 students have found out about this project (makes you wonder why former students look at the web page from a class they took 1-2 years ago), and commented to me that they thought it sounded fun. That’s the idea. Hopefully, this is a fun way for you to experiment with coordinate systems. The minimum requirements are quite simple, but hopefully people will be creative and make cool stuff!

Page last modified on November 03, 2008, at 09:10 AM