Author: Derek Tatum *How the four-point subdivision works: The four-point subdivision is different than that of simple linear subdivision in that it does not merely average two vertices and divides by 2. Rather, It takes the average of 3 surrounding points (the previous, the next, and the next next point) and uses geometrical a formula (-1/16*previous_point + 9/16*current_point...etc.) to provide a different sort of average scheme. This average scheme is smooth, and tends to ease the animation. See the applet for an example. *How Four-point produces the animation: Once the interpolation has been computed, the animating part is actually pretty simple. Note that a Polyloop is essentially an array of points. Thus, to animate, all you have to do is iterate through the "finished" Polyloop (with the four-point interpolation computed on it), and draw each iteration. Each Polyloop iteration will be drawing an entirely new Polyloop. *****Please note that in order for my program to be more efficient, and had to take out the 'b' compute requirement, and just implement it when 'f' or 'a' is pressed. I would have left it in, but I didn't want to create more Polyloops (and thereby take up more space) so I merely re-write over the Polyloops used in both the Linear and Four-point algorithms. Below is a demo of my showing the various types of animation by my program. Please note that I only did the subdivision twice in the video for the linear/four-point methods so as to conserve space. Thus, each Polyloop on has 32 vertices instead of 256 as in the applet. Download .zip file of source code |