flowchart4
2014-09-11 01:35:56 +0000
var width = window.innerWidth;
var height = $('body').height() - 3;
var halfWidth = width / 2;
var halfHeight = height / 2;

function drawerSketch(processing) {
  // set size
  processing.size(width, height);

  var theta = 0.0;

processing.setup = function() {
  processing.rectMode = "CENTER";
};

processing.draw = function() {
  processing.pushMatrix();
  processing.translate(processing.mouseX, processing.mouseY);
  processing.rotate(theta);
  processing.rect(0,0,10,20);
  var dist = processing.dist(processing.mouseX, processing.mouseY, processing.pmouseX, processing.pmouseY)  ;
  theta += dist / 50;
};

processing.keyPressed = function() {
  console.log(processing.key);
};

processing.mousePressed = function() {

};

processing.mouseReleased = function() {

};

}
// attach the sketch function to the canvas
var processingInstance = new Processing(document.getElementById('sketch'), drawerSketch);