Page 2: Graphics Park
Spring 2026 Sample Solution
Over the next few weeks, we’ll build Graphics Town. To start, we will begin with something less ambitious: a park. We’ll add some “rides” to the park to make it more like an amusement park than just a playground.
You can see the beginnings of a park below (05-02-01.html). The code is located in three files:
- 05-02-01.js makes the park: it makes the world and places the playground equipment into it;
- 05-02-01-simplepark.js defines a simple example of an animated object;
- 05-02-01-parkobjects.js defines the more complex animated objects.
You should look over all the files; you will have to change both 05-02-01.js and 05-02-01-parkobjects.js .
The requirements are as follows. We recommend doing them in order to learn how the code works:
-
Look at the simplest example (the bouncing cube) in 05-02-01-simplepark.js . Make sure you understand it, and then take it out of the main setup in 05-02-01.js since it is distracting and really has no place in a park.
-
The file 05-02-01-parkobjects.js has several playground toys defined in it. Some of these are already placed in the world. Make sure you understand these examples as well. Also, you should place some new ones in the world.
Right now, there are two “roundabouts” (a playground toy that spins around - sometimes these are called “orbiters” or “spinners” or “spinning wheels” - see Roundabout). There is a simple one and a fancy one. These are good examples to understand.
The same file also defines some other objects (a swing and a carousel). Place at least one more swing set and one carousel in the park. This will give you a chance to see how we place objects in the world using the framework. Note that this does not require you to change the objects (class definitions), but it does require you to edit the world setup function.
When you add objects, you will need to make sure that appropriate
importstatements are included in the 05-02-01.js file. You should also make sure that you position the different playground toys so they have some space between them. -
We have started to make a “carousel” or “merry-go-round.” While the Wikipedia page says these can be like the “roundabout” above, what we really intended was an amusement park “merry-go-round” where horses (or other things you sit on) go up and down while the ride spins. There was a famous one at Ella's Deli on the east side, until it closed. We’d like you to expand the spinning thing we started to be more like one of these. You need to place “horses” on the poles. You can use simple geometry for the horses (a cube or other primitive), but there needs to be one on each pole, and it needs to go up and down as the merry-go-round spins. Note: the pole can go right through the object. This will require you to edit the constructor and
stepWorldfunction for theCarouselclass. -
Make your own object and put it into the scene. Preferably, this should be something appropriate for a park. It can be simple, but we want to see that you can create a new class of object that moves. Maybe a bird flying in the sky, or a tree that waves in the wind, or a child riding a bicycle on a path.
These are the three simple changes (remove the bouncing cube, add another swing, and animate the merry-go-round) and one less-simple change (new object type). But in the process, you’ll get to see the framework code and get some practice making and animating a hierarchical object using THREE.JS (and our framework).
For advanced/creative credit, you can do better than the minimums.
-
Make another merry-go-round that has nice geometry (like horses and other animals, or something else). You can add more poles if you need to.
-
Make more amusement park rides that have hierarchical motion. Things like tilt-a-whirls, spinning teacups, or (well, I don’t know the names for these things). See the “flat rides” on Trip Savvy for names, or a Google image search for “spinning amusement park ride” turns up lots of things. It is more important that the rides have hierarchical motion than they have detailed geometry. Your ride must be animated and have hierarchical motion.
This extra ride is in addition to what you had to make for standard credit (the object that you made for 4 above cannot count for both basic and advanced points). You may make up to two rides.
Everything you do for this exercise should be in the files 05-02-01.js and 05-02-01-parkobjects.js . Make sure that they show up properly in the view below on the page!
You may add object files subject to the assignment rules: explain their origin in the text file below, use legal assets, avoid excessively large files, and avoid features not yet discussed in class.
The park (05-02-01.html):
view - look at the box and experiment with it
examine - look at the code for the box
edit - change the box's content
rubric - several steps are suggested in the rubric page - form elements on page in rubric
05-02-01.html 05-02-01.js
| Kind
Kind of rubric items: standard - expected from all students advanced - used to get a better grade creative - an opportunity to do something creative levels - rubric item graded by selected achievement level optional - not required, but encouraged |
Description | |
| standard | take out bouncing cube | |
| standard | place at least 1 more swing | |
| standard | place carousel | |
| standard | carousel has poles and ''horses'' | |
| advanced | carousel has correct motion (spins, horses go up and down) | |
| advanced | more theme park rides 1 (with hierarchical motion) | |
| creative | more theme park rides 2 (with hierarchical motion) | |
| creative | creative or exceptional theme park ride |
Describe what you’ve done in this type-in box. In particular, describe any advanced or creative features: