Monday, October 31, 2005

IFS Designer Update

I just uploaded a new version of my IFS designer. The changes are:
  • Added save and load functions
  • Added some simple examples (sierpinski triangle, fern, square and square spiral)
  • You can now use the left mouse button to move (translate) the view for both the transform display window and the fractal window.
  • You can now use the right mouse button to zoom (scale) the view for both the transform display window and the fractal window.
  • Fixed an evil little bug with the transform selector that was causing IFS performance to be very poor. It should select the transforms at random weighted by the size of the determinant but instead it picked the last transform much more often. This caused the point density of the fractals to be all wrong but the fractals were still mostly the right shape. I love resillient algorithms, especially ones that can survive me!
The next issue I have to tackle is that the cl-sdl based fractal viewer (the rest is ltk) has it's own event loop so you have to quit it (hit q) before you can go back to editing the transforms. I guess I'll have to mesh the ltk and cl-sdl event loops together.

Friday, October 28, 2005

IFS Designer first Release


I have just made the first release of my IFS Designer program.
The new features are:
  • Generates IFS Fractals in an SDL window. I realize that this is the whole point but since it's the first release even core functionality is a new feature!
  • SDL window allows you to zoom into the fractal you've created. This is useful because many of the nice familiar fractals are contained in a unit square so without zooming they'd just be a dot and where's the fun in that?
  • The interface allows you to easily select and manipulate transformations that make up the fractal. Thanks Ltk!
  • Choose the number of points you draw for the fractal so you can get almost instant results or dense images.
  • LLGPL License for both the IFS Designer and the matrix library

Of course feedback is always welcome.

Monday, October 24, 2005

IFS Designer Project starts to take shape.


I've been putting in some work on my new and interesting project. It's a fun little app developed in common lisp with Ltk (a lisp interface into tcl/tk) in slime. It allow you to design 2D IFS fractals by graphically manipulating the transforms that comprise them.
I really like the IFS algorithm because it's just sooo simple:
  1. Take a number of transformations (scale, rotate, translate). Three is enough to produce a nice standard fern-like fractal.
  2. Starting at the origin, apply the transforms in a random order (weighted by the size (determinant) of the transformation matrix)
  3. After about 100-200 iterations, start to draw the points.
  4. Finish when you feel the image is dense enough.
Simple eh?
I'm no mathematician but the why goes like this:
  • The transforms represent a fractal attractor - the transforms are a very concise description of a set of points in space.
  • Each transform maps a part of the attractor onto itself - when you start on the attractor and apply one of the transforms the result will still be on the attractor.
  • Applying a transform to a random point will make it closer to the attractor - I suppose this is why it's called an 'attractor' :) . This is why you discard the first few points, to make sure you're at least near the attractor when you start to draw the points.
  • Weighting the picking of the transforms by determinant isn't actually necessary but it does improve the performance of the algorithm.
I'm not ready to show off any IFS fractals (yet) but I can give you the matrix library I developed for this project.

Thursday, October 20, 2005

My new blog, Yay!

The purpose of this blog is not just to big-up myself. I will be doing that plenty don't worry but the real purpose of starting this is to force myself to actually let other people see some of the software I write.

I'm a big fan of open source software and I'd like to achive the dual ends of entertaining myself and giving something to the movement that has given me so much great software. In order to do that I'm going to have to open myself to criticism. I'm sure that I'm not the only one who has developed a nice little library of interesing stuff but is too scared that people will think that it's rubbish to actually do anything but play with it myself. So I have resolved to stop simply masturbating and start, no no that's as far as I'm prepared to push that particular metaphor.

I guess I'll also be putting some other stuff up here as the mood takes me, it will probably mostly be to do with sci-fi books but I expect the occasional post about UK/US culture shock will creep in as I get out there more and find a job and stuff.