24-786 GEOMETRIC MODELING Spring 98
Carnegie Mellon University
PROJECT SUMMERY by Jeremiah Jacobson
2D Morphing
Links to files:
Introduction
Initially, the purpose of this project was to make a program that could morph any two 2D set of bezier curves. However, the difficulties in showing a graphical animation, approximating bezier curves, and making data files limited this somewhat. The final result is a program that will morph between two designs containing an equal number of cubic bezier curves (and therefor an equal number of data points).
Graphical Interface
I used OpenGL to display a drawing of line segments approximating a cubic bezier curve (much like the algorithm used in problem set 6). Using a loop, an animation of drawings from one set of curves to the next was made so that a smooth transition between the two designs is shown graphically within about 5 seconds. OpenGL has many abilities to display in various ways, which proved to be a conquest to find the code necessary for providing just a simple 2D drawing animation. At this point, a 3D version of this program would have been no harder to achieve than the 2D version.
Approximating Bezier Curves
This program relies of a set of files containing the control points for cubic bezier curves. This was the initial step to achieve a working program, with the intention of producing code that would approximate any order bezier curve. However, the difficulties involved with producing an agorithm that would achieve this proved to be more difficult that originally imagined. This problem is due mostly to the unknown number of points required for intermediate calculations of the approximated coordinate point on the curve.
Furthermore, since only cubic bezier curves are used, two drawings containing a different quantity of control points provided a significant difficulty. In order to morph, the number of control points in one file has to approach the number of control points in the other file as the morphing progresses. However, one control point cannot be eliminated because the result will be a non-cubic bezier curve, and because of this problem, files with different quantities of control points cannot be used.
All this would be possible with more time. Much time was used trying to learn OpenGL.
Conclusion
Only two sample pairs of files exist because of the tediousness of creating a file. However, the user is free to make their own files, according the format shown in the sample files. The final outcome in OpenGL was quite beautiful actually. The animation is smooth and clean. With more time, this could be much better, allowing a 3d environment with an uncontrolled number of varrying types of bezier curves. Had I thought earlier, the difference between 2D and 3D bezier curves is insignificant, and would have been nicer. However, this would also have increased the complexity of making designs to morph. Also, next time, a windows platform would be desirable, although OpenGL tends to make things more difficult there too.