Page 9: Exercise 3: Construction Site

CS559 Spring 2023 Sample Solution

Over the next few weeks, we’ll build up Graphics Town. So, to start with, we’ll need to get some construction equipment to start building.

In terms of real learning goals, construction equipment is often great examples of articulated objects - they consist of pieces that rotate or translate relative to each other. Things like dump trucks, excavators, cranes, cement mixers, pile drivers, etc. Also, this will let you try out more of the framework code, in particular the automatic creation of UIs for object parameters.

If you’re curious, this is a simplified version of the 2008 Construction Site, when they were building WID and Union South. The 2008 Excavator was a bit nicer than the one given in the sample here. Now, we see similar machines building the new Computer Sciences building, so the assignment is timely again.

We’ve started out with two examples: a tower crane and an excavator. If you look at the construction site at the bottom of the page you can see we’ve given two example machines. For both, the AutoUI creates sliders to control them. Notice how each machine has parameters (and therefore sliders) for position and orientation, but also for its articulations.

The code is in 07-09-01.js ( 07-09-01.html).

You need to create some more machine types. Here is a list of ideas to help you get started:

  • Tower Crane
  • Truck Crane
  • Telescoping Truck Crane
  • Excavator (see 2008 Excavator)
  • Mini-Loader
  • Fork-Lift
  • Fork-Lift Crane
  • Bulldozer
  • Front-End Loader
  • Dump Truck
  • Cement Mixer
  • Back-hoe
  • Garbage Truck
  • Concrete Pumper (Potratz or Gordy's)
  • Pile Driver

There are examples of a crane and an excavator in 07-09-constructionobjects.js. Both have multiple degrees of freedom (2 for the crane, 4 for the excavator - we don’t count the overall position and orientation).

The requirement is that you must create two new types of construction equipment and place them into the world. Each machine needs to have at least 1 degree of freedom beyond its position and orientation in the world. So, for example, you could make a dump truck and a fork-lift (each one degree of freedom). You can get advanced points for more degrees of freedom.

The two machines should be different: don’t make two variants of a dump truck. If you make another tower crane or excavator, they should be sufficiently different from the ones we’ve given you.

You can make the machines with rough geometry - build them out of boxes and cylinders. Or you can try to make nicer shapes. The most important thing is their behaviors: that you can control their articulations. The machines should be “good enough” that someone can tell what they are (give them a descriptive name too). You can get advanced points for nicer shapes. We will also give you a point for using colors/materials appropriately (the machines shouldn’t be all the same color).

Remember: the key here is to make things that are articulated. There should be multiple (rigid) pieces that translate and rotate relative to each other (controlled by parameters that can be connected to the sliders).

You will need to create new classes of objects for your new machine types. You can refer to the examples we have provided.

Note that in this exercise, you will be using the update method of the objects you define so they can be controlled by sliders. You will also have to define the parameters in the constructor, and include the call for AutoUI in the world setup function.

Please see the framework code ground rules on Page  7  (The CS559 Framework Code (GraphicsTown)). The example class HingeCube in TestObjects.js can give you a simple example of an articulation to start with. A hint: the HingeCube is the beginnings of a dump truck.

As on previous pages, you can load geometry, subject to the same rules.

You can earn advanced points for making an additional machine, for making nicer shapes, for using colors/materials well, and for having more than the minimum degrees of freedom. And possibly for doing something cool that we didn’t think of.

You must list the features you have implemented in the text file 07-09-01.txt:

The end!

That’s the end of workbook 7. Don’t forget to save, commit, push, and fill in the hand-in quiz when you are done! Workbook 07 Handin (due Mon, Mar 27)

Page 9 Rubric (28 points total)
Points (20):
Box 07-09-01
4 pt
equipment 1 is identifiable (can tell what it is)
Box 07-09-01
4 pt
equipment 2 is identifiable
Box 07-09-01
4 pt
equipment 1 has correct articulation
Box 07-09-01
4 pt
equipment 2 has correct articulation
Box 07-09-01
3 pt
UI works for 1&2
Box 07-09-01
1 pt
good use of colors/materials for all equipment (not just one color)
Advanced points (8) (maximum 10 can be earned in this workbook):
Box 07-09-01
3 pt
third machine identifyable with working articulation
Box 07-09-01
2 pt
nice shapes
Box 07-09-01
2 pt
more than the minimum degrees of freedom on the objects
Box 07-09-01
1 pt
at least one object has 4+ d.o.f. (beyond position/orientation)