GLgraph is my first Perl program and is a ported Version of my old Worm(g).
GLgraph visualize mathematical functions. It can handle 3 unknowns (x,z,t) and can produce a 4D function with 3 space and 1 time dimension.
It began with my first program Worm(g)... Because I didn't find a mathematical function visualiser which fit my needs, I started to write my own in pascall (Worm(g)). GLgraph is a perl/OpenGL portation of my first Worm(g) program. It's result was a complete new structured program.
You can add your own functions to the default ones. All math functions of Perl's math module can be used (even trigonometrical). PI is built in too and the function interval can contain complex solutions.
3.2. Output modes
There are 3 Modes:
-2d) : 3D Graph (very fast ;)
-wire) : 3D Wireframe model
-3d) : Default, solid 3D model (slowest)
There are 4 Modes:
-noaxis) : Default
-axis 1) : Changes automaticaly from 2D to 3D
-axis 2) : Draws a base square
-axis 3) : Draws a base cube
The time can also be used as a parameter. But to get acceptable fps the resolution has to be lowered.
After one time periode, the saved display lists are being used to display the frames. This leads to a tremendous speedup (animation). The flimmering is caused by the clear call which can be deactivated with the
-noclear option (looks ugly).
Large time and space resolutions can lead to crashs/freezes (memory), don't use this
methode in this case (
See bellow to save the function as an animation.
There are 3 modes:
-nocolors) : Fastest mode ;)
-colors 1) : Default, my own iterative color mode
-colors 2) : Absolute color scale (slow)
3.7 Preview mode
The preview mode can be toggled with the
p key. It uses a resolution of 20
(x and z) and can be used to avoid intense calculation while trivial changes.
Glgraph uses Imagemagick's import over a system call to take screenshots. All Imagemagick output formats are therefore supported. A non-default output name (default is image.jpg) can be specified with the
A screenshot can be taken using the
To create an info file with a function description, use the
If no extension in the output name is present, just the info file will be created.
To create a movie of the whole function, do as follows:
glgraph -save <options> -o movie.jpg
mencoder -vop scale movie\*.jpg -mf on:fps=<fps> -ovc lavc -lavcopts vcodec=mjpeg -o movie.avi
mencoder -vop scale movie\*.jpg -mf on:fps=<fps> -ovc divx4 -o movie.avi
glgraph [options] 'function1' 'function2' ...
4.2. Command line options
glgraph -h for a list of available options.
4.3. Control from keyboard
glgraph -h for a list of available keys.
Display the default builtin GLgraph functions
The same without colors and a wireframe model
glgraph -wire -nocolors -xzres 20
A 2D Graph (color mode 2) of a normal parabola
glgraph -2d -colors 2 -notime -xres 600 -nocolors 'x*x'
The same with no colors and axis
glgraph -axis 1 -ax_size 1 -2d -notime -xres 600 -nocolors 'x*x'
High quality picture of the default function
glgraph -xzres 150 -tmin 1 -notime -cfact 1 -cconst 0.1
Create info file of the default function
glgraph -i -o function1
Q: I use perl-OpenGL 0.4 and get an error about
A: Perl-OpenGL 0.4 seems to be incompatible with GLgraph (see libopengl-perl's README file for more details). Upgrade to perl-OpenGL >= 0.5.
Jonas Jermann (g0th) <firstname.lastname@example.org>
David Gunzinger (pfy) <email@example.com>
GLgraph is under GPL v2 license. Read the file COPYING for more details.
7.2. Standard Disclaimer
Use only at your own risk! There may be errors and inaccuracies that could be damaging to your system or your eye. Proceed with caution, and although this is highly unlikely, we don't take any responsibility for that!