Amanda Ladd

CS 3451 Project 04:
Morphing Between Polyloops


Download Project
Or
View Project

Background

Preview of Project 4 Preview of project 3 This project computes the smooth trajectories of the control points of a specified number of polyloops. The intermediate smooth frames of the trajectories may be viewed or an animation can be played that will cycle through the frames one at a time.

The four-point subdivision algorithm was used (as required) to compute the smooth trajectories.

How the Four-Point Subdivision Algorithm works

The four-point subdivision algorithm is a smoothing algorithm that works by finding the midpoint between every edge of a polyloop and bulging that midpoint outwards by a certain displacement. This algorithm leaves the original vertices where they are, but because of the inserted mid-points, it will end up doubling the number of verticies of the polyloop everytime.

The algorithm gets its name because it takes four points, or vertices, to calculate the location and displacement of a mid-edge point by displacing the mid-point away from the average of its neighbors.

For example, for vertices A, B, C, and D of a polyloop, for edge AB and DC, you would extend B and D by a certain factor, in our case by 9/8, then find the midpoint of the line that connects the newly displaced points.

How the Four-Point Subdivision Algorithm was used to produce the animation

The four-point subdivision algorithm was used to produce the animation in the following way. First, an array T of polyloops was created to hold a total of thirty-two polyloops, one corresponding to each vertex of a sword. For any polyloop T[i], its vertices consisted of taking the i-th vertex out of each of the eight control polyloops contained in CP[]. The T[i] polyloop contains the path that the i-th vertex of the sword will follow during the animation. When the four-point subdivision algorithm was applied to each polyloop T[i], the resulting polyloop contained a smooth trajectory path for each vertex in a sword. For each time frame t, a new polyloop was constructed and drawn by taking the j-th vertex out of each of the thirty-two T[i] polygons, where j is equal to t for t < 256.

Extra Credit

Computed linear version of trajectories.

Download

Download Project (Applet, Code, Data)