lissajous, a C code which computes a Lissajous figure based on user input, and uses OpenGL to display it.
The user specifies information about the number of points, and the form of the two sine curves involved. Depending on these parameters, the resulting shape may or may not be a closed curve. The user also specifies a range for the underlying T parameter. Again, depending on the parameters, this value may result in a closed curve being drawn several times, or a closed curve being only partially drawn.
The program plots N points along the curve
t(i) = i * T2 / ( N - 1 )for 0 <= I <= N - 1.
x(i) = R1 * sin ( ( A1 * t(i) + B1 ) * 2 * pi )
y(i) = R2 * sin ( ( A2 * t(i) + B2 ) * 2 * pi )
The user specifies N, T2, A1, B1, A2 and B2. The parameters R1 and R2 are currently fixed at 1.
lissajous n t2 a1 b1 a2 b2where
The information on this web page is distributed under the MIT license.
lissajous is available in a C version and a C++ version and a MATLAB version and an Octave version and a Python version.
fern_opengl, a C code which uses OpenGL to display the Barnsley fractal fern.
flood_opengl, a C code which uses OpenGL to allow the user to select regions of a 2D image and flood them with color, by Art Wetzel.
life_opengl, a C code which simulates a version of John Conway's "Game of Life", displaying the results using OpenGL.
opengl_test, a C code which illustrates the use of the OpenGL graphics library;
screenshot_opengl, a C code which shows how a program using the OpenGL graphics library can save a screenshot of the graphics being displayed.