/* Builds a spirograph based in the internal radius and iterations given in argv. This software supports random colors or gradient colors, random colors wont work on Windows Machines It can combine several spirographs The opengl window will show you both discs (external and internal on the right if just one spirograph selected) it will also show you the points of the internal radius being drawn The software requirements are OpenGL and Glut in linux I compile gcc -O2 -lGL -lglut -lGLU beckgraph.c -o beckgraph Usage: if you want to combine 2 spirographs, use the following command: ./beckgraph 30,20 20,10 30,20 means that the first spirograph will have 30 as its internal radius and beckgraph will draw 20 curves using 20 points of the internal radius 20,10 is the same, with different values, the result will be 2 overlapped spirographs If you want random colors (I did not like my random colors but you can try) ./beckgraph 30,20 20,10 -r If you want to overlap more spirographs, use the same logic ##################################################################################################################################### IMPORTANT NOTE: This source code has errors and it will crash with certain values (I have not programmed a good error handling yet) this is open source and here is the license. ##################################################################################################################################### License: Copyright (c) 2011, Eduardo Ruiz Duarte All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. All advertising materials mentioning features or use of this software must display the following acknowledgement: This product includes software developed by the University of California, Berkeley and its contributors. 4. Neither the name of the University nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY EDUARDO RUIZ DUARTE ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL EDUARDO RUIZ DUARTE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */