Page 7-9: Exercise: Construction Site

Page 7-9: Exercise: Construction Site

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, ... Also, this will let you try out more of the framework code, in particular the automatic creation of UIs for object parameters.

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 9-construction.js and 9-constructionobjects.js.

You need to create some more machine types. Here is a list from the 2008 version of the assignment:

In the file TestObjects.js there is an object called a HingeCube that can give you a simple example. Otherwise, Luke has made a crane and an excavator in 9-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 minimum requirement is that you must create one or two new types of construction equipment and place them into the world. Between these one or two new types of construction equipment, there needs to be at least 2 articulated degrees of freedom (the rotation/translation to position the machine doesn't count). So, for example, you could make a dump truck and a fork-lift (each one degree of freedom), or a single back-hoe or concrete pumper (many degrees of articulation). The position and orientation of the machine do not count as degrees of articulation.

The two machines (or two degrees of freedom) 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. You should say what the machines are, but they should be "good enough" that someone can tell.

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 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.

Bonus Points: The minimum requirements allow for simple geometry and only a few degrees of articulation. For bonus points, you can make more machine types, more complicated machines, and nicer looking machines.

If you want to make a nicer excavator, see the 2008 assignment excavator page. Note: unlike in 2008, you do not have to do the kinematics.

A version of this assignment was given in 2008. Students had to do more than just make the machines.