Just a little fun one because I've finished my exams and I haven't had time to start any big projects yet. A bit of very simple inverse square law gravitational physics to simulate the sombrero galaxy. All orbiting stars are attracted to the centre of the galaxy by an amount proportional to 1 over the square root of the distance between them.
Just click the two images below to launch the 2D and 3D simulations! Enjoy.
The three examples below show that with slightly different initial conditions, the shapes we find in a simple galactic simulation like this one, are actually surprisingly similar to those we see in real galaxies, for example in the first you can almost see the emergence of the spiral arms of our own galaxy the Milky Way.
Monday, 31 May 2010
Thursday, 27 May 2010
Self Painting Images in Flash
Leading on from the previous post I decided to automate the painting process. The brush moves around the screen randomly creating a stipple like effect by increasing and decreasing pressure. Take a look, its really quite hypnotic. Just click on the image below to launch it.
Labels:
AS3,
Paint,
procedural generation
Wednesday, 26 May 2010
Wet Paint Mixing in Flash
One of my favourite features on Photoshop CS5, is the wet mixer brush, which is almost like a real paintbrush to use. I decided that if photoshop could do it, so could I, and a started to work on writing some actionscript that would handle the job.
The basic idea is that a brush is made up of bristles. When you press down on the screen each bristle picks up a certain amount of paint from the pixel it is currently over, and then as you drag your brush around, each bristle drags paint around underneath it.
To do this I wrote some actionscript that found the colour under each bristle, mixed the paint that was already on the bristle with the new paint underneath it, and then moved that new colour to the new location of the bristle. The program draws the paint stroke onto a new layer, a kind of buffer, which it then blurs (for added realism) and copies back onto the original painting.
Here are a few initial results:
Original Image
Painted version:
And here are a few more examples of another image created with it. I'm actually getting similar results as with the photoshop brushes which I'm quite pleased about. To launch the application simply click here and give it a go for yourself. Let me know what you think!
The basic idea is that a brush is made up of bristles. When you press down on the screen each bristle picks up a certain amount of paint from the pixel it is currently over, and then as you drag your brush around, each bristle drags paint around underneath it.
To do this I wrote some actionscript that found the colour under each bristle, mixed the paint that was already on the bristle with the new paint underneath it, and then moved that new colour to the new location of the bristle. The program draws the paint stroke onto a new layer, a kind of buffer, which it then blurs (for added realism) and copies back onto the original painting.
Here are a few initial results:
Original Image
Painted version:
And here are a few more examples of another image created with it. I'm actually getting similar results as with the photoshop brushes which I'm quite pleased about. To launch the application simply click here and give it a go for yourself. Let me know what you think!
Labels:
AS3,
Paint,
Photoshop,
procedural generation
Subscribe to:
Posts (Atom)










