Risorse





Joachim Breitner: FrakView: An Haskell Renderer for Iterated Function Systems

For a recent university seminar, I wrote a haskell program to render and edit iterated function systems (IFS), which generates a certain class of fractals, namely self-similar sets. I think the result is quite nice, so I’m sharing the code.

With FrakView you can view a rendering of the attraktor of the IFS, whith a choice of two algorithms (a straight forward, and a probabilistic), configurable depth and anti-aliasing. You can also modify the IFS by dragging the colored boxes with arrows you see on the screenshot. For the academically inclined, there is also support to visualize cylinder sets and otherwise explore the coding space of the IFS a bit.

The program is written in haskell and uses gtk2hs, the gtk bindings for haskell. It might be interesting for other gtk2hs programmers to see how FrakView solves some issues: For example, it uses the CoroutineT monad transformer I recently blogged about – check out the pausingForM_ function in GUI.hs. Also, the current state of the screen is in one algebraic data type (ScreenConfig) that supports equality checks, so when the user interacts, the code recomputes the new ScreenConfig (using getRenderer), but only redraws the screen if it differs from the previous. This is much easier and more robust than having to decide for each possible user interaction whether it changes what’s on the screen.

You can get the source from the FrakView darcs repository.



Inserito il 17/05/2008 -- Planet Debian -- Leggi l'articolo originale.


Buydifferent.it

Qui trovi RAM per Eee PC a
partire da 19,90 euro.
Garantita a vita

Inoltre Secure Digital HC  Eee PC per espanderne la capienza fino a 20 GB.
A partire da 14,90 Euro



Sondaggio*

Ti piace la nuova grafica?
Si, è bellissima
19%
Si, abbastanza
39%
Si, è nella norma
13%
E' meglio dell'altra, ma nulla di che
13%
Non proprio
6%
No
2%
No, per nulla
5%
Chi ha fatto sto obrobrio?
4%
Voti totali
* per votare devi effettuare il login






Collabora

ZioBudda.net sta crescendo sempre di più, ma mi serve una mano per portare avanti i progetti e per rendere il sito sempre più bello e pieno di informazioni.






Si ringrazia:

Unbit.it Cybernetic.it website counter