NATURE of CODE

16 September

Similarly to «Creative Coding» MOOC I decided to create a new Padlet to display the examples and sketches of this course.

Example of Perlin Noise

// Daniel Shiffman
// https://www.kadenze.com/courses/the-nature-of-code
// http://natureofcode.com/
// Session 1: Perlin noise

// “x-offset” in Perlin noise space
var xoff = 0;

function setup() {
createCanvas(640, 360);
}

function draw() {
background(51);

// “regular” randomness
// var x = random(0, width);

// Perlin noise value
var x = noise(xoff) * width;

// Move through perlin noise space
xoff += 0.05;

fill(255);
ellipse(x, 180, 48, 48);
}

Example Random Walker

ar w;

function setup() {
createCanvas(640, 360);
// Make a Walker object
w = new Walker();
}

function draw() {
background(51);
// Update and display object
w.update();
w.display();
}

function Walker() {

// Start Walker in center
this.pos = createVector(width / 2, height / 2);

this.update = function() {
// Move Walker randomly
var vel = createVector(random(-5, 5), random(-5, 5));
this.pos.add(vel);
}

this.display = function() {
// Draw Walker as circle
fill(255);
ellipse(this.pos.x, this.pos.y, 48, 48);
}
}

15 September

MOOC «The Nature of Code», promoted by Processing Foundation and his co-founder Daniel Shiffman, in platform Kadenze, starting mid-September 2016.

https://www.kadenze.com/courses/the-nature-of-code-ii

 

Advertisements