Posts

Rendezvous With Rama

Rendezvous With Rama Rendezvous With Rama is a seminal work by Arthur C Clarke. It tells the tale of a long cylindrical object, probably some kind of starship, that enters our solar system. It is named Rama by Earth and, as it gets closer, an expedition is sent out to make contact with it. At first the object seems dead and doesn't respond to any attempts at contact. The expedition members find a way on board and discover a world within the object featuring lakes and buildings but still an alarming lack of life. As Rama gets closer to the sun strange things begin to happen. Robotic creatures appear and the buildings shift in shape. Eventually the expedition has to leave, as it is evident that Rama is picking up speed and they will be stuck inside forever. The expedition, once again safe in their own ship, watch as Rama departs taking its mysteries with it and leaving humanity behind - an insignificant encounter. And here is the code: let t ...

A Seaside Village

Image
A Seaside Village With the lovely weather of last week, I was inspired to create a new piece. I call this A Seaside Village.  I've used p5js once again (I do love it) and forked the code from  @Saya Kubota  to draw the houses and make the grainy effect. I think it came out quite nice and reminds me of walking along the front in Aberdyfi, chips in hand, on a spring/summer's day. Here's the code: const PALETTE = ['#CFECF7','#A0D9EF','#62C1E5','#20A7DB','#1C96C5']; let noiseGra; let waveX = 0; let waveY = 400; function setup() { createCanvas(600, 600); noiseGra = createGraphics(width, height); noiseGra.loadPixels() for( let x=0; x<=width; x++) { for(let y=0; y<=height; y++) { noiseGra.set(x, y, color(255, noise(x/10,y/10,x*y/50)*random([0,40,80]))) } } noiseGra.updatePixels(); } function draw(){ randomSeed(0); noStroke(); //console.log(mouseX,mouseY); background(200); fill(194,174,128); rectMode(COR...

AB38 "Genesis"

Image
  AB38 "Genesis" On a sunny March morning it's always lovely to see the famous AB38 ship off to work in Bae Ceredigion. The ship has been around since 1981 and its catches are sold all along the Dyfi coastline. If you like seafood and eat in a restaurant in the area then you've probably eaten something caught that day by the crew of Genesis.

Cosmic Gobstoppers

Cosmic Gobstoppers This little effect is based on Rainbow Storm by mathisvdr.  I converted the dweet to p5js. I have NO IDEA how the maths works! For a creative coder, my maths skills leave a lot to be desired! But, with a little bit of tweaking and research, I managed to create a nice sketch. Dweets are interesting. They're golfed code. Golfed code comes from the game of golf, where you try to complete a hole in as little moves (par) as possible. Golfed code takes a block of code and strips it down to the bare minimum. This is mathisvdr's golfed code, which would fit in a tweet as it is 138 characters long: function u(t) { c.style.filter='invert()';for(i=836;i--;x.fillRect(i%38*50+5,~~(i/38)*52+2,45,45))x.fillStyle=`hsl(${i*S(t)},99%,${S(i**3+t)**33*90+10}%)` } This is my code, which is more readable but would not fit in a tweet: let t = 0; function setup() { createCanvas(400, 415); colorMode(HSL, 360, 100, 100); } ...

Review: Jason X

Image
  Jason X For the past umpteen years I've been watching horror films on significant horror dates. On Halloween I watch one of the Halloween movies and on Friday 13ths I watch a Friday 13th movie. This year, a month ago, I watched Friday 13th Part IX: Jason Goes to Hell. That film was, well, god awful to be fair. The best bit was at the end where Freddy Krueger's glove comes along and pulls Jason's mask into the ground, paving way for Freddy vs Jason. But before you can get to that film you have to watch Jason X. Well, you don't have to but, to be fair, it is enjoyable nonsense. The plot, if such a thing exists, is Jason, somehow alive again, gets cryogenically frozen, wakes up 450 years later on a spaceship and goes on a killing spree. That's it. And, well, it's actually quite good. It's still rubbish, but, as slasher movies go, it was actually one of the best. I enjoyed every daft moment of it. Lexa Doig and Lisa Ryder, two turn of the century scifi stalwa...

Tutorial: Hello, world! in Z80 Assembly Language

Image
  I'm feeling kind of nostalgic today so I thought I'd write Hello, world! in Z80 assembly for the ZX Spectrum! The last time I wrote any Z80 assembly was when I was 14 so around 36 years ago! I may be a little rusty! Here it is: org $8000 ld bc, TEXT LOOP ld a, (bc) cp 0 jr z, EXIT rst $10 inc bc jr LOOP EXIT ret TEXT defb "Hello, world!" defb 13, 0 How this works line by line: org $8000 - this line puts the program into memory location $8000 ld bc,TEXT - ld stands for load. We load register bc with the memory location of what comes after the label TEXT LOOP - the beginning of our printing loop. We will be printing each letter at a time. ld a,(bc) - now we load register a with the content of register bc. As register a is a single register and can only take a single byte at a time, then the content of bc loaded into register a will be the letter H (the first letter in Hello, world!) cp 0 - stands for compare 0. We check if ...

La Isla Bonita

Image
La Isla Bonita Another drawing made using P5JS based on an image I've found online. This one was a bit more difficult as the original has lots of shadows. I decided to forgo some of the shadows to make my image more simple. I think it turned out quite well. I called the sketch "La Isla Bonita" as it reminded me of the Madonna song from my childhood. Here's the original. I think this is an AI pic. It doesn't really matter. And here is my version: And here is the code: function setup() { createCanvas(400, 600); angleMode(DEGREES); } function draw() { background(255); stroke(0); strokeWeight(3); push(); translate(-30,0); // centre whole image /* hat */ push(); noFill(); //brim strokeWeight(6); translate(200,100); rotate(30); ellipse(0,0,60,80); //top strokeWeight(5); arc(-10,-10,40,40,20,320); arc(-10,-5,40,40,10,180); pop(); strokeWeight(3) //crease line(180...