pseudoberries random thoughts about life, hacking and open source

bregne

Bregne

bregne is a C program which draws a fern by using a fractal algorithm. This was part of the Creative Mathematics course I attended in high school. There are two programs: bregne and bregne-libplot.

The bregne program uses libSDL to draw the fern. It plots the fern and renders it only once. This is the fastest of the programs.

The bregne-libplot program uses libplot to plot the fern. It updates the display while rendering so you can see what it's currently doing. It also changes the colors of the pixels during the rendering process which adds a nice visual effect. This is the slowest of the programs. If you're using compiz fusion, libplot might cause the compiz.real process to hang while using 100% of the CPU. Either disable compiz before you run the libplot version of this program or you might have to kill -9 compiz.real via a remote shell.

The bregne/bregner directory contains some non-colored renderings of different number of iterations of the algorithm.

Requirements

  • libSDL for the bregne program
  • libplot for the bregne-libplot program.

Installation

Unpack the archive and run make to compile bregne:

$ tar jxvf bregne.tar.bz2
$ cd bregne
$ make

For the bregne-libplot program, run:

make bregne-libplot

Usage

To run the bregne program, type:

./bregne

Or for bregne-libplot:

./bregne-libplot

Comments (0) Trackbacks (0)

No comments yet.


Leave a comment


No trackbacks yet.