Showing posts with label sky. Show all posts
Showing posts with label sky. Show all posts

Thursday, August 26, 2010

Skies & Silhouettes

Click the image on the left to start the demo. Update: There appears to be a bug that shows up in Chrome, where the sky is really blocky, but it works fine in FireFox. I've got big plans for doing a project with heaps of skies and silhouettes (I'm kind of obsessed by them), and made this little program to quickly test out what different generated skies look like. I had fun playing with it, hope you do too. Try out some examples, change the color values and click the button. Update: (23/9/10) Added MaxAlpha setting, the actual alpha is a random number between 0 and this value, so the fact that you can set a number much higher than 255 is a feature not a bug.

Saturday, June 19, 2010

Flock in a cloudy blue sky

Click on the image to load the canvas demo (requires FireFox or non-IE browser) I took the existing Javascript boids implementation from Coderholic, and made it look pretty with swallows on a cloudy background. The birds follow the standard 3 rules for Boids as first implemented by Craig Reynolds Separation: steer to avoid crowding local flockmates Alignment: steer towards the average heading of local flockmates Cohesion: steer to move toward the average position of local flockmates These simple rules for each individual leads to the group behavior - there is no central group intelligence or control. Flocking behaviors like this are often described as being emergent. Update: (23/9/10) There is now an initial pause as the simulation runs 500 steps before displaying the boids. This removes the ugly initial craziness before they start flocking properly.

Tuesday, May 18, 2010

Cloudy blue Perlin sky


Click on the image to load the canvas demo (requires FireFox or non-IE browser) Perlin Noise is a technique for generating procedural textures, commonly used for smoke, clouds or to add a random looking realistic roughness to surfaces. The algorithm is basically to generate noise, then scale that noise randomly across an image at different sizes and levels of transparency. This creates a self similarity which mimics the appearance of some natural processes. I found a canvas implementation by iron_wallaby and made the noise be the transparency of pure white, giving a cloud like effect. This was originally going to be just the background for another canvas demo I was working on, but that is delayed as I'm currently doing bioinformatics study/working on a project in my spare time. Things to improve on this are restricting how cloudy it is to a range, and removing some visual artifacts (lines/blockiness)