<- previous index next ->
There are many interesting curves and surfaces that are represented by parametric equations. These may be used in GUI applications. My reference book is: "CRC Standard Curves and Surfaces" by David von Seggern, CRC Press, ISBN 0-8493-0196-3. The uses include defining motion such as the cycloid for making the robot walk or 3D objects that may be useful or just interesting. To understand the examples below, you will have to read the code. The screen shots are just small samples. curv_surf.c The basic idea is to have a standard way to size and parameterize curves and surfaces. Then a standard set of points can be generated and these points used either for static drawing or for dynamic movement, as in a target for a game. 3D surfaces are a bit more complicated. I tend to write a specific program to generate the 3D surface in some standard format, I use .dat, then I can combine the 3D objects into a sceen. make_spiral_635.c is a typical program to generate a 3D object. The output is spiral_635.dat which is not much to look at. The image drawn by light_dat.c is:A second example, to see the great similarity, is: make_helix_635.c is a typical program to generate a 3D object. The output is helix_635.dat which is not much to look at. The image drawn by light_dat.c is:
From the book "Curves and Surfaces" a cylindrical spiral was easily generated as shown in make_cyl_spiral_635.c that made the file cyl_spiral_635.dat file displayable in light_dat as:
The same code was dropped into an OpenGL program to create surf3d.c showing the object as a wireframe.
<- previous index next ->