Transformation 1

Beispiel aus dem Kapitel Processing in JavaScript.

Code

var a = 0;

function setup() {
  createCanvas(200, 200);
}

function draw() {
  background(0);
  rectMode(CENTER);
  translate(width/2, height/2);
  rotate(a);
  rect(0, 0, 120, 15);
  a += 0.01;
}