University of California, Berkeley
EECS Dept, CS Division
Jordan Smith SLIDE: Scene Language for
Interactive Dynamic Environments
Prof. Carlo H. Séquin

Home Goals Publications People Gallery Assignments Distributions

Assignment #2: "Car Into Plane" -- Polygon Editing and Morphing

Program Specification

In this assignment you will learn more about user interaction techniques with the OpenGL graphics library and SLIDE. You will be developing a polygon editor which can emit both a static file of the moved geometry or a dynamic SLIDE scene where the original geometry morphs into the modified geometry.
Again, this assignment has to be done INDIVIDUALLY.

Polygon Editor

The polygon editor will read in a SLIDE file describing a polygon, allow the user to move the vertices around using rubber-banding, and write out the SLIDE description of the resulting polygon or of the dynamic scene morphing from the original to the edited polygon.

1. When the LEFT mouse button is pressed, the vertex that lies under the cursor is selected for movement. While the LEFT mouse button is held down, the selected vertex moves with the cursor, and the line segments connected to the vertex are redrawn to reflect the new vertex position. When the LEFT mouse button is released, the vertex keeps its new position.

2. File menu button "Write" should write out a static file of the new geometry.

3. File menu button "Write Morph" should write out a dynamic file which can be viewed in the slide viewer program. This morph scene should include a Tcl/Tk scale widget (a slider) that will allow the user to morph from one geometry to the other.

This slider should control an interpolation variable t that varies between 0.0 and 1.0. Interpolation value t = 0.0 represents the first object, t = 1.0 represents the second object, and any value 0.0 < t < 1.0 represents an interpolated mix of the two objects. Depending on this t value, your program will draw an interpolated face where each corner is a linear combination of the positions of the corresponding vertices in the two objects. Thus if the position of vertex n in the first object is a, and in the second object is b, the interpolated values would be: t * b + (1 - t) * a.

4. Hitting the ESCAPE key exits the program.

Use your code from Assignment #1 to define a first SLIDE single polygon in the outline of a "car". Then use your new interactive polygon editor to distort this car into the shape of a "plane", -- keeping the same number of vertices. Output a SLIDE interpolation program on these two objects. Use the provided slide viewer to run your morphing file.


Getting Started

Follow the listed instructions for as2.

This code parses simple SLIDE files like the ones made by the program in assignment 1. It also builds a basic data structure, and outputs SLIDE. You need to modify it to make the editor described above. Details on which files you need to work on are in the file as2/README. There is also an example dynamic slide file which demonstrates some of the tcl/tk constructs you will need. And finally an example of the iterators you need to traverse the data structure. There is also a basic Tcl intro online.


SLIDE Class Hierarchy


Submission Details

1. This second assignment must also be done individually.

2. Name your executable slideedit (i.e. Debug/slideedit.exe). It should be named car_plane.slf.
Also keep around the two input files that contain definitions of the car and plane objects.

3. Follow the listed instructions for as2.




This page was originally built by Jordan Smith.

Last modified: Saturday, 28-Aug-2004 15:12:37 PDT