Programmatically creating cool images
Posted by Tariq • Friday, January 9. 2009 • Category: Programming
One of the elective courses in the final year of my undergraduate degree course in software engineering was Graphics I (and later followed by Graphics II). For our Graphics I project we were first shown Pixar's famous lamps short. After it had played we were told our project would be to do our own 3d animation greater than 1 minute in duration. The only restriction was that all objects needed to be generated in the program, so no loading up really complicated open source stuff. I wrote a 3d animation of fighting stick men which was way more than I could chew at the time so they ended up shooting each other from a distance :-p. Anyway since then I have been in love with generating all types of images using pure code.
It is amazing what can be achieved and I like taking very functional things and messing around with them, introducing randomness where possible and letting recursion do all the work. A good example of this is my banner image. It would be hard to guess it's generated by a program that I wrote a few years ago to visualise solutions to the Towers of Hanoi problem. The image at the top of your page just contains lots of disks with some, small, randomisation in their x,y placement and colour, but somewhere in there are all the steps to move X disks from disk A to disk C while never placing a larger disk on a smaller disk.
Give it a go. If you have some functional program which does something like visualise some problem then introduce some randomness, colour, change the shapes and opacities and see what comes out. You may be pleasantly surprised.
It is amazing what can be achieved and I like taking very functional things and messing around with them, introducing randomness where possible and letting recursion do all the work. A good example of this is my banner image. It would be hard to guess it's generated by a program that I wrote a few years ago to visualise solutions to the Towers of Hanoi problem. The image at the top of your page just contains lots of disks with some, small, randomisation in their x,y placement and colour, but somewhere in there are all the steps to move X disks from disk A to disk C while never placing a larger disk on a smaller disk.
Give it a go. If you have some functional program which does something like visualise some problem then introduce some randomness, colour, change the shapes and opacities and see what comes out. You may be pleasantly surprised.
0 Comments
Add Comment