Project 03 – Dynamic Drawing

sketch
var angle = 0 ;
var x=50 ; 
var y=50 ;


function setup() {
    createCanvas(600, 450);
}

function draw() {
	background(mouseX/5,mouseY/5,(mouseY+mouseX)/10);
	stroke(0,mouseX/5,width-mouseY/5);
	strokeWeight(mouseX/100);
    for (let w=0; w<=width;w+=30){ //setting up circle grid 
    	for(let h=0;h<=height; h+=30) {
    		r = 75 * exp(((-1)*dist(mouseX, mouseY,w,h))/100); //varying size with mouse position
    		fill(width-mouseX,height-mouseY,mouseY/5) //varying color of balls with mouse positoin
    		ellipse(w,h,r) ; //circle
    	}
    }
    push();
	translate(mouseY,mouseX); 
	rotate(radians(mouseX));
	fill(mouseY);
	strokeWeight(mouseY/100);
	ellipse(x,y+100,dist(mouseX,mouseY,x,y+100)/10,dist(mouseX,mouseY,x,y+100)/10); //circle floating on top

	translate(mouseX,mouseY);
	rotate(radians(mouseY));
	ellipse (x,y, dist(mouseX,mouseY,x,y)/10, dist(mouseX,mouseY,x,y)/10) ; 
	
	translate(mouseX*0.4,mouseY*0.8);
	rotate(radians(mouseY*0.5));
	ellipse(x+80,y,dist(mouseX,mouseY,x+80,y)/10,dist(mouseX,mouseY,x+80,y)/10);
	pop();
 

}


Leave a Reply