sha = new p5.Shader(this.renderer, vert, frag);
WebFont.load({google: {families:["Roboto:900"]}});
createCanvas(windowWidth, windowHeight, WEBGL);
canvas = createGraphics(width, height, WEBGL);
var myText = createGraphics(width, height);
myText.textFont("Roboto");
myText.textAlign(CENTER, CENTER);
myText.text("R", width/2, height/2);
canvas.image(myText, -width/2, -height/2);
sha.setUniform('resolution', [width, height]);
sha.setUniform('time', millis()/1000);
sha.setUniform('mouse', [mouseX, mouseY]);
sha.setUniform('tex', canvas);
sha.setUniform('vel', vel);
canvas.rect(-width/2, -height/2, width, height);
image(canvas, -width/2, -height/2);
cos(angle) * radius + pos.x,
sin(angle) * radius + pos.y,
cos(angle) * -radius + pos.x,
sin(angle) * -radius + pos.y
pos = createVector(mouseX-width/2, mouseY-height/2);
angle = atan2(mouseY-height/2 - pos.y, mouseX-width/2 - pos.x);
function mouseReleased(){
sha.setUniform('angle', angle);
sha.setUniform('pos', [(pos.x+width/2)/width, (pos.y+height/2)/height]);