CS450 Program 4

Building a simple polygonal object.

Due February 22, 1996

Introduction.

The purpose of this exercise is to introduce you to DX and have some fun constructing a simple animation.


Procedure:

First you will need to download four files. To do this, click on each of the filenames shown below. When the text window opens, use the "save as" option to put the file in your own directory. Name each file with the same name as shown below.

After downloading the files, start DX then open the program MakePolyhedron.net and execute it. Be sure to open the control panel. You should see a tetrahedron in the Image window. The "options" menu in the Image window contains a "view control" item, which in turn contains a "Mode" menu. Experiment with rotating and zooming the tetrahedron. Use the control panel to choose a cube or octahedron shape. Note that the tetrahedron is defined interactively as a pair of "Vectorlists" interactors, but that the other two shapes are defined with list modules. Note also that any shape you make can be saved in a file to be used later in another program (which can Import the file). It it not necessary to understand the program logic at this point (that is, you don't need to know what the Options, construct or replace module does) but you must be able to modify the defined shapes.

The control panel has interactors to define the vertices and faces of a polyhedron. Edit the face list so that one of the faces in "inside out". Note that the "outward" face of a polygon is defined as the side you see if you traverse the vertices in a counter-clockwise direction. Edit the face list and vertex list to make a single triangle.

Open and execute the "2octahedron.net". Open the control panel and vary the color of one shape or the opacity of the other shape. Open the sequencer and click on the arrow to make a simple animation. Modify the Rotate module to animate around the Z axis. This net serves as a very brief introduction to animation. The image below shows one view generated by this program.

Modify the program MakePolyhedron to make a cube with one face that opens to show a propellor inside. The propeller should be made of four equilateral triangles sharing one edge and oriented 90 degrees apart. You will probably want to use the interactive lists to design this object. You may want to design it using any convenient coordinate system and then scale it appropriately to fit inside the cube. The cube opening should be controlled by a sequencer and the opening should be proportional to a sinusoidal function of time. Each different object you define will need to be connected to its own set of "option, construct, replace" modules. For instance, you might make the propellor, cube (minus top) and the top as three objects which are then collected together. In this case you would need three sets of "option, construct, replace" modules. One of the inputs to the Color module is defined as "front colors" so that the back and front of objects will look different. For your modified program, change this parameter to "colors" so that both sides of objects will be colored. A single frame might look like the following image.

For fun, you may also want to try hooking up the propeller to the sequencer so that it spins inside the box.


What to turn in.

When you save your program, two files will be created with extensions .net and .cfg. You should email these two files to Pornsiri Muenchaisri (muenchp). Please place comments in each of your modules so that we can figure out what they are supposed to be doing.


Last modified, Wed Feb 7 13:31:36 1996 by Tom Dietterich.

Copyright (1995) by Cornell University. Copyright Statement