back to processing
I’ve been creating some rudimentary experiments in Processing, to get back into the way of coding.
First, there was my attempt to create a portrait from short, straight lines. The sketch is given a high-key, close-up photograph of a face. It picks random points below a certain level of brightness then draws short lines between them:

There are three main variables: the cut-off level of brightness, the number of random points picked, and the maximum length of line allowed. It would be possible to add sliders to the sketch, so that these variables could be controlled by the viewer. I looked at the ControlP5 library for use in the Erasure exhibition (which incidentally ended yesterday), but decided against using it for the interactive elements. I might try it for this exercise though.
drawing again
Last night I went to a fun evening called Artistic Adventures for Adults. It was run by Access Art, and showed us lots of drawing techniques that we could use in workshops. Most of that time we sat on the floor, making a mess with charcoal and crayons on huge sheets of paper. Great fun!
None of the exercises was longer than ten minutes, so we produced a huge amount of work in the three hours. I made all this and more:
on display
I rarely mention my work here, but a strange thing happened there recently.
I frequently walk past the interactive I created for the ceramics gallery, and even though it’s four years since it was finished, I always get a pleasant feeling when I see someone using it.
Yesterday, however, I saw some more of my work on display, and it felt far more significant. A frame from my animated logo for the Erasure exhibition is on the large banner at the entrance to the white gallery, and an advert for the exhibition has been put on display in the passenger lift. These promotional items have both been created by the museum’s designer, so they feel separate from me, as though they have an independent existence with an identity of their own.
That’s why they feel more significant than watching my animated logo at the start of the two looping DVDs I edited for display in the exhibition. That seems more directly connected to me, and therefore less interesting.
So how will it feel when the long version of the banner goes up on the railings outside the museum?
drawing class
I’ve just been to the first life drawing class at The Exchange in Hanley. It was a small group, just the right size. We had lots of quick poses, which suits me fine, followed by one longer pose at the end.
We were encouraged to experiment, so I tried a cubist style for a couple of them. I’ll have a look at my sketches in the cold light of day before deciding whether or not to post any!
There are a few more classes planned there, at different times on different days, and I’m hoping to go back next Wednesday.
cracked it
Another good Skype session with Ollie on Monday. We started to develop the previous session’s particle system into a smoke simulation.
I couldn’t get to sleep that night, and lay in bed wondering about using Perlin noise in the smoke simulation when I suddenly realised I’d found a solution to some code I’d been struggling with a few weeks ago. (OK, it took a while, but I got there in the end). I’d been trying to write code to simulate cracks, and had used Perlin noise to give them a natural look. It worked, but what I’d been unable to do (until my belated Eureka moment) was specify exactly where the crack should start.
Now I can do precisely that, so the way is open to write the code as a function that accepts parameters, which means I could call the function from within itself to get smaller, branching cracks. Yay, me.
Still got a long way to go with the smoke simulation, though.
useful particle system
Another fascinating Skype session with Ollie on Monday evening when we set up a basic particle system. I’ve explored these before, but what was different was the creation of a Force class as well as the particle class. Instances of the class can be created as many times as you like within each particle. By passing different parameters during the creation of each force, you can specify how they act. It’s so simple, but very useful.
I’ve since created lots of different types of particles just by changing a few parameters: fireworks, fountains, sparks, and balls, with forces of momentum, gravity, wind and air resistance.
I’ve still to get the rebound right when particles bounce off the floor, but after that, my goals are to explore mass and smoke.
variations on a theme
I’ve been spending a lot of time coding recently, which has been great. Mostly I’ve been writing short sketches that take an image and do different things. In doing this, I’ve learned a few new techniques.
They’re designed to be flexible, so that they’ll work with any image. but really, in their current form, they would work best with images that have large areas of well-defined darks. I could add an interactive control for the user to select the cut-off level, so that it can be adjusted to a more appropriate setting for each image they’re applied to.
In the meantime, here are a few examples. Some are stills from animated sequences.
fused glass
We made glass light-catchers yesterday at a glass ‘taster’ workshop with Paul Floyd at the Ruskin Glass Centre in Stourbridge. I’d been looking forward to it, but I was surprised just how absorbing and enjoyable the session was. Paul taught us the basics of fusing, where pieces of glass are melted until they run together. He has some beautiful examples in his studio.
After practicing cutting out shapes in thin, clear glass, we each chose a pattern, coloured it in as a guide, and cut shapes of coloured glass to match. Not surprisingly, the narrow curving shapes proved the hardest, and although it was hard to know how much of a gap to leave between each piece, the inaccuracy of my cutting meant that my attempts at precision weren’t successful. Still, it was fun trying, and I’d like to practice more.
Each piece had to be cleaned to remove fingerprints and any lines we’d drawn in pen as a guide to cutting, then we stuck them down on a circular sheet of clear glass. We both chose to add some frits – small pieces of glass or powder – for further decoration.
We now have to wait for Paul to fire our pieces and post them to us. I’ll post a photograph when it arrives. Paul is starting some evening classes soon, which I’d love to go to – it’s just a shame that Stourbridge is too far away for that to be practical.
mighty biomorphin’ power rangers
It’s been a while since my last post, mainly because I’ve seen a lot of impressive work in various places and I’ve felt very small and insignificant in comparison. I also went on a training course recently which claimed that 80% of people achieve only 20% of their potential. As someone who likes to potter about and explore different things, I know that I fit into this category. Perhaps I ought to buckle down and concentrate on one particular thing. But the use of the word ‘ought’ is enough to put me off. Like most people, I’m not good at persevering at something I’m not been interested in.
I’d been feeling this despondency to such an extent that I was beginning to wonder whether I’d reached the end of my little experiment in genetic algorithms. For various reasons I’d not had a session with Ollie on Skype for several weeks until tonight , and I was starting to wonder whether it was worth chasing down every little aspect of code. I know now how to implement these algorithms, so perhaps it was time to move onto something else.
Well, how foolish was that thought? Very.
Tonight’s session was stimulating. Ollie suggested a technique to overcome a particular coding problem (showing me that I needed to convert in one place from an Integer object to a primitive int), as well as getting me to think of a way to speed up the routine that checks whether each fly has been trapped by a web. Those are both very useful for the sketch, but what really got me interested was the discussion afterwards about where we could take this next.
I was getting bogged down in the appearance of the sketch and in the limited number of characteristics included in the coding. So far I’ve been using ellipses as a quick and dirty representation of webs. These are both boring and limited, but because the webs are a class, it would be easy to replace the ellipses with something else, such as Richard Dawkins’ biomorphs. Rather than use human intervention to select which creatures breed, they could be ranked on their success in trapping flies. This opens up a lot of possibilities. If a fly successfully moves past the outer edge of the biomorph, then an inner arrangement would be useful to add another layer to trap it. This means that sheer size isn’t the only aspect of a successful predator.
The more successful webs could have more energy to use in the next generation, so some might evolve to require lots of energy but therefore need to trap a lot of flies, while others might need less, and therefore survive on very few flies. It would be possible to reach a point where some creatures have evolved so far from each other that they can’t breed with each other. The flies could evolve too. Very soon there could be enough complexity that it would be difficult to predict the results. Suddenly I’m very interested again in this exercise.
private functions
I’m on a roll now, with a second abstract class, this time to handle the breeding of creatures. I’ve kept it general, so it could be used for other genetic algorithm sketches.
One method, for the first generation, returns a string of random 1s and 0s, while another (still to be tested) accepts two ‘parents’ and breeds them, with an optional chance of mutation. I’ve also moved some functions, such as building the webs out of the DNA, into the web class and made them private so they can’t be accessed from outside. It’s all looking a lot more organised and controlled.






