GMU:Actors, Traces, Collectives/SS17/sketch01: Difference between revisions

From Medien Wiki
(Created page with "<syntaxhighlight lang="java"> void setup() { size(640,360); } void draw() { background(255); PVector mouse = new PVector(mouseX,mouseY); PVector center = new PVecto...")
(No difference)

Revision as of 10:19, 8 June 2017

void setup() {
  size(640,360);
}

void draw() {
  background(255);

  PVector mouse  = new PVector(mouseX,mouseY);
  PVector center = new PVector(width/2,height/2);

  mouse.sub(center);

  translate(width/2,height/2);
  line(0,0,mouse.x,mouse.y);
}