Workbook 6, Page 9: Programming Task 2

Workbook 6, Page 9: Programming Task 2

Exercise: Museum

Curate your own Space-Age Sculpture Museum!

In this part of the assignment, we give you some starter code for a "museum." It has pedestals to display things, spotlights to shine on them, and cameras to look at each thing in more detail. The only problem - this museum doesn't have much on display.

(We say "space-age" because the objects magically float above their pedestals).

Your job is to add some new objects for museum visitors to see. We've given you one simple object to start with. You must add three more objects, to fill the other three pedestals. You may build these objects up from primitives as you did with the snowman, or you may import any of the sample objects in the "OBJ" folder included in the project (Note that you should not import objects you find online. We need to limit the number of items to download for grading).

As with the snowman, you can use simple materials of different colors (e.g., MeshPhongMaterial or MeshStandardMaterial). Again, the point is not to have the fanciest material, just try different settings out and see what you come up with.

Now, it would be boring if the objects simply sat on the pedestals. You will add a cool sci-fi effect and set each object to float just above its pedestal, spinning slowly in place. If you want the effect to be more convincing, you could (optionally) embellish the motion by making the objects bob slightly, as if they were suspended in some kind of energy field.

In addition, you will need to adjust the position and rotation of the provided spotlights and cameras such that each spotlight shines on one object, and cameras 1, 2, 3, and 4 each point at one object. The "main" camera should remain in the same position and orientation.

Recap of requirements:

• Add three objects (built from primitives or imported from OBJ folder).
• Give each object a material.
• Make each object float and slowly spin above its pedestal.
• Move each spotlight to shine down on one of the objects/pedestals.
• Move each camera (other than "main") to point at one of the objects.

We may award bonus points if you made particularly cool objects and/or have them move in interesting ways. But remember, you must follow the assignment ground rules.

A basic example (from the main camera view) is shown below:

We've given you a start in the file 9-Museum.js (where you should put your code). Some details of the starter code are given below:

The first portion of the code (up to line 33 or so) just sets up the basic scene. You can find the functions called there at the bottom of the file, including the code that creates the pedestals. There you can find out the positions of the pedestals, so you know where to put your objects. The next block of code sets up a single cube on top of a pedestal, with a spotlight pointed at it, to demonstrate what you need to do.

After this, there is code to generate the remaining three spotlights, and the four cameras that will individually point at objects in your scene. You can use the cube example for reference on the names of methods/properties that you need to set.

Finally, there is an "animate" function, where you should add the code that makes your objects float and rotate above their pedestals.