Looking Outwards – 03

The Mediated Matter group creates fabrication tools to enhance the relationships between our natural and man – made environments. It also focuses on material ecology.

One of their projects, the Aguahoja II builds upon this technology by creating biopolymer skin. They used a generative pattern of rigid veins containing high concentrations of cellulose within the multi-material skin. Something that I most admire about this project is its functionality and how purposeful it is.  By incorporating natural pigments and dyes, the patterns that are inspired by them can be used to communicate with other organisms. The creators artistic sensibilities come in with the fact that they get to create and turn the different culmination of patterns into skin.

https://www.media.mit.edu/projects/aguahoja-ii/overview/

Blog – 03

I am most inspired by the work of Amanda Ghassaei. She has been making groundbreaking artwork for years and continues to push computational art’s limits. One project of hers that I admire is her locked letters project which she worked on in 2021. Letter-locking is the practice where a letter becomes its own envelope through a series of complex folds. Ghassaei uses x-ray microtomography and a fascinating “virtual unfolding” method to read sealed letters without even opening them. Although I am not familiar with microtomography, according to her website she uses “3D reconstruction of the folded packet using data collected by a high-resolution microtomography scanner” to create her artwork. Additionally, I really admire her work on 3D printing a record player(2012). I commend this because it is a rarity in the 3D printing realm, and it actually produces music just like any other vinyl! According to her website, she imported raw audio data, did some geometrical calculations, and eventually exported this geometry directly to a 3D printable file format. Check her work out below!

Locked Letters (2021)
https://amandaghassaei.com/projects/locked_letters/

3D Printed Record (2012)
https://amandaghassaei.com/projects/3D_printed_record/

By: Katie Makarska

Project 03

sketchDownload
// Ilia Urgen
// Section B

var angle = 0;

var color_1;
var color_2;

var background_lines = 0;

var triangle_1 = 1;
var triangle_2 = 2;
var triangle_3 = 3;
var triangle_4 = 4;
var triangle_5 = 5;
var triangle_6 = 6;


function setup() {
    stroke (2);
    createCanvas (800, 800);
    color_1 = color (255,140,0);
    color_2 = color (63,191,191);

    for (var y = 0; y < height; y++ ) {
        n = map (y,0, height, 0, 1);
        var color_3 = lerpColor (color_1, color_2, n);
        stroke (color_3);
        line (0, y, width, y);
    }
}                                                                  
function draw() {
    
    delta_x = mouseX/6;
    delta_y = mouseY/6;

    frameRate(30);

    stroke (2);
    push();

    translate(400, 400);
    rotate(radians(angle));

    if (background_lines == 0) {
        line (0,0, width, height);
        line (width, 0, 0, height);
        angle += 25; 
    }

    if (triangle_1 == 1) {
        // changes 1st darkest color gradient
        fill (132-mouseX/4, 0, 132-mouseY/4);
        // changes thickness and width of triangle
        triangle (0,0, -(delta_x + 100), delta_y + 150, (delta_x + 100), delta_y + 150);
        angle += 5;
    }

    if (triangle_2 == 2) {
        // changes 2nd darkest color gradient
        fill (152-mouseX/4, 0, 152-mouseY/4);
        // changes thickness and width of triangle
        triangle (0,0, -(delta_x + 80), delta_y + 120, (delta_x + 80), delta_y + 120);
        angle -= 15;
    }

    if (triangle_3 == 3) {
        // changes 3rd darkest color gradient
        fill (176-mouseX/4,0,176-mouseY/4);
        // changes thickness and width of triangle
        triangle (0,0, -(delta_x + 60), delta_y + 90, (delta_x + 60), delta_y + 90);
        angle += 200;
    }

    if (triangle_4 == 4) {
        // changes 4th darkest color gradient
        fill (204-mouseX/4, 0, 204-mouseY/4);
        // changes thickness and width of triangle
        triangle (0,0, -(delta_x + 40), delta_y + 60, (delta_x + 40), delta_y + 60);
        angle -= 150;
    }
    
    if (triangle_5 == 5) {
        // changes 5th darkest color gradient
        fill (232-mouseX/4,0,232-mouseY/4);
        // changes thickness and width of triangle
        triangle (0,0, -(delta_x + 20), delta_y + 30, (delta_x + 20), delta_y + 30);
        angle += 100;
    }

    if (triangle_6 == 6) {
        // changes 6th darkest color gradient
        fill (255-mouseX/4,0,255-mouseY/4);
        // changes thickness and width of triangle
        triangle (0,0, -(delta_x), delta_y, (delta_x), delta_y);
        angle -= 55;
    }

    pop();
}

Project 3 Dynamic Drawing

The piece is inspired by 3D Glasses, and the relationship between Red and Blue light in bringing images “off the screen.” I think it has a really cool holographic affect to it that is also brought about with proximity and rotation.

HOLD DOWN ON MOUSE TO CHANGE SIZE AND COLOR

sketch

//Aarnav Patel
//Section D

var side;
var midX = 0;		//the coordinates of the middle squares (what the other squares are proportional to)
var midY = 0; 
var rotation = 0;
var color1 = 255;
var color2 = 0;


function setup() {
    createCanvas(600, 450);
    background(220);
    text("p5.js vers 0.9.0 test.", 10, 15);
    side = width / 32;	

}

function draw() {

	//change my origin to the middle of the canvas to better organize my rectangles
	translate(width / 2, height / 2);
	background(0);
	noStroke();
	colorMode(RGB);

	//side rectangles are proportionally equidistant from the middle square (based on x value)
	xdiff = min(mouseX / 2, (width / 2) - side);
	ydiff = min(mouseY / 2, (height / 2) - side);
	

	//Red Rectangles (TOP ROW)
	fill(color1, 0, color2, 100);
	push();							//Create its own coordinate system (for rotation)
	translate(midX, midY - ydiff);	//MID square coordinate place
	rotate(radians(rotation));	
	rectMode(CENTER);				//means that the x and y value below are the CENTER of the rectangle
	rect(0, 0, side, side);
	pop();							//reset coordinate sytem for next rectangle

	push();
	translate(midX - xdiff, midY - ydiff);	//LEFT square coordinate place
	rotate(radians(rotation));
	rectMode(CENTER);
	rect(0, 0, side, side);
	pop();

	push();
	translate(midX + xdiff, midY - ydiff);		//RIGHT square coordinate place
	rotate(radians(rotation));
	rectMode(CENTER);
	rect(0, 0, side, side);
	pop();

	//blue rectangles (BOTTOM ROW)
	fill(color2, 0, color1, 100);
	push();
	translate(midX, midY + ydiff);		//MID square coordinate place
	rotate(radians(rotation));
	rectMode(CENTER);
	rect(0, 0, side, side);
	pop();

	push();
	translate(midX - xdiff, midY + ydiff);		//LEFT square coordinate place
	rotate(radians(rotation));
	rectMode(CENTER);
	rect(0, 0, side, side);
	pop();

	push();
	translate(midX + xdiff, midY + ydiff);		//RIGHT square coordinate place
	rotate(radians(rotation));
	rectMode(CENTER);
	rect(0, 0, side, side);
	pop();

	rotation = rotation + 1;	//Increment rotation so squares always spinning

	
	if (mouseIsPressed) {	//if user holds mouse, it changes color (switches blue and red values of each row)
		if (color1 != 0) {
			color1 -= 1;
			color2 += 1;
		} else {
			color1 += 1;
			color2 -= 1;
		}


		if (side >= width) {	//if rectangles get too big for the canvas, it resets back to initial side length
			side = width / 32;
			color1 = 255;
			color2 = 0;
		} else {
			side = side * 1.01;
		}
	}

	

}

Looking Outwards 03 – Computational Fabrication

Purl installation at night – photoluminescent fibers charge during the day with solar power.

One project that especially inspired me was Jenny Sabin’s’ Purl installation in Abu Dhabi. The project is a very immersive example of Computational Fabrication being used to create an environment. The installation serves as an “interactive” canopy, which has digitally weaved photoluminescent fibers. What really inspires me about this piece is the incorporation of computational biomimicry, and this allusion to patterns in nature with this high tech piece. It relates to Andy Lomas’ Cellular Forms exploration, which highlights the beauty of morphogenetic processes through an ambiguously generated form. The piece is extremely organic, which bolsters its intent/message of fostering a community/ecosystem within the commissioned area. 

As per the article, Sabin’s work employs the use of modularity, and understanding how the parameters of these recursive functions produce these overarching environments. In context of the concept of gestaltum and parametric objects, it’s interesting to recognize the variables that were adjusted to create the specific weaves – whether the relationship between the hexagonal shapes indicates the numbers used? 

Purl, Jenny Sabin 2020

Project-03: Dynamic Drawing

Moving the cursor up and down can change the rotation direction of the white “flower”. Moving the cursor left and right can change the canvas color and the size of the circles. If the cursor is inside the circle, the corresponding circle will change color.

Xinyi Du

sketch
//Xinyi Du 
//15104 Section B

var w = 20;
var x1 = 150;
var y1 = 150;
var w1 = 220; 
var x2 = 400;
var y2 = 300;
var w2 = 260;
var x3 = 500;
var y3 = 75;
var w3 = 130;
var r = 30;
var g = 144;
var b = 255;
var lineY = 1000;
var angle = 10;
var dia = 15;

function setup() {
    createCanvas(600, 450);
}
 
function draw() {
    background(r, g, b);
    noStroke();
    //left circle
    r1 = 100;
    g1 = 149;
    b1 = 237;
    fill(r1, g1, b1);
    ellipse(x1, y1, w1, w1);
    // bottom circle
    r2 = 100+20;
    g2 = 149+20;
    b2 = 237+10;
    fill(r2, g2, b2);
    ellipse(x2, y2, w2, w2);
    //right circle
    r3 = 100-20;
    g3 = 149-20;
    b3 = 237-10;
    fill(r3, g3, b3);
    ellipse(x3, y3, w3, w3);

    // change mouse X to change the size fhe circles as well as the color of the canvas
    if (mouseX < width/2) {
        w1 = constrain(w1-5, 150, 400); //decrease left circle size
        w2 = constrain(w2+5, 200, 450); // increase bottom circle size
        w3 = constrain(w3-5, 80, 280); //decrease right circle size
        r = constrain(r + 0.5, 30, 60);
        g = constrain(g + 0.5, 144, 174);
        b = constrain(b + 0.5, 255, 275); // make canvas color lighter and limit the rgb range
    }

    if (mouseX > width/2){
        w1 = constrain(w1+5, 150, 400); //increase left circle size
        w2 = constrain(w2-5, 200, 450); //decrease bottom circle size
        w3 = constrain(w3+5, 80, 280); //increase right circle size
        r = constrain(r - 0.5, 5, 30);
        g = constrain(g - 0.5, 114, 144);
        b = constrain(b - 0.5, 225, 255); // make canvas color darker and limit the rgb range
    }

    // if mouse is inside the circle, change color
    if (dist(mouseX, mouseY, x1, y1)<w1/2){ 
        r1 = 195;
        g1 = 177;
        b1 = 225;
        fill(r1, g1, b1);
    //left circle
        ellipse(x1, y1, w1, w1);
        }
    if (dist(mouseX, mouseY, x2, y2)<w2/2){
        r2 = 189;
        g2 = 181;
        b2 = 213;
        fill(r2, g2, b2);
    // bottom circle
        ellipse(x2, y2, w2, w2);
        }
    if (dist(mouseX, mouseY, x3, y3)<w3/2){
        r3 = 204;
        g3 = 204;
        b3 = 255;
    //right circle
        fill(r3, g3, b3);
        ellipse(x3, y3, w3, w3);
        }

    // draw white lines and circles
    stroke(255);
    noFill();
    strokeWeight(1.2);
    ellipse(mouseX, mouseY, w+10, w+10);

    translate(mouseX, mouseY); // translate the origin from (0,0) to (mouseX, mouseY)
    line(0, 0, 0, lineY); //one line and three circles on the line
    ellipse(0, 60, dia); ellipse(0, 130, dia+20);ellipse(0, 200, dia+40);
    rotate(radians(angle)); // rotate the line and repeat the process
    line(0, 0, 0, lineY);
    ellipse(0, 40, dia); ellipse(0, 100, dia+10);
    rotate(radians(angle)); // rotate the line and repeat the process
    line(0, 0, 0, lineY); 
    ellipse(0, 60, dia); ellipse(0, 130, dia+20);ellipse(0, 200, dia+40);
    rotate(radians(angle));
    line(0, 0, 0, lineY);
    ellipse(0, 40, dia); ellipse(0, 100, dia+10);
    rotate(radians(angle));
    line(0, 0, 0, lineY);
    ellipse(0, 60, dia); ellipse(0, 130, dia+20);ellipse(0, 200, dia+40);
    rotate(radians(angle));
    line(0, 0, 0, lineY);
    ellipse(0, 40, dia); ellipse(0, 100, dia+10);
    rotate(radians(angle));
    line(0, 0, 0, lineY);
    ellipse(0, 60, dia); ellipse(0, 130, dia+20);ellipse(0, 200, dia+40);
    rotate(radians(angle));
    line(0, 0, 0, lineY);
    ellipse(0, 40, dia); ellipse(0, 100, dia+10);
    rotate(radians(angle));
    line(0, 0, 0, lineY);
    ellipse(0, 60, dia); ellipse(0, 130, dia+20);ellipse(0, 200, dia+40);
    rotate(radians(angle));
    line(0, 0, 0, lineY);
    ellipse(0, 40, dia); ellipse(0, 100, dia+10);
    rotate(radians(angle));
    line(0, 0, 0, lineY);
    ellipse(0, 60, dia); ellipse(0, 130, dia+20);ellipse(0, 200, dia+40);
    rotate(radians(angle));
    line(0, 0, 0, lineY);
    ellipse(0, 40, dia); ellipse(0, 100, dia+10);
    rotate(radians(angle));
    line(0, 0, 0, lineY);
    ellipse(0, 60, dia); ellipse(0, 130, dia+20);ellipse(0, 200, dia+40);
    rotate(radians(angle));
    line(0, 0, 0, lineY);
    ellipse(0, 40, dia); ellipse(0, 100, dia+10);
    rotate(radians(angle));
    line(0, 0, 0, lineY);
    ellipse(0, 60, dia); ellipse(0, 130, dia+20);ellipse(0, 200, dia+40);
    rotate(radians(angle));
    line(0, 0, 0, lineY);
    ellipse(0, 40, dia); ellipse(0, 100, dia+10);
    rotate(radians(angle));
    line(0, 0, 0, lineY);
    ellipse(0, 60, dia); ellipse(0, 130, dia+20);ellipse(0, 200, dia+40);
    rotate(radians(angle));
    line(0, 0, 0, lineY);
    ellipse(0, 40, dia); ellipse(0, 100, dia+10);
    rotate(radians(angle));
    line(0, 0, 0, lineY);
    ellipse(0, 60, dia); ellipse(0, 130, dia+20);ellipse(0, 200, dia+40);

    // change mouseY to change the rotating direction and rotation angles
    // if mouseY is at the bottom half of the canvas, increase the rotation angle
    if (mouseY < height/2) { 
        angle = constrain(angle + 0.5, -10, 20);
    }
    // if mouseY is at the top half of the canvas, decrease the rotation angle
    if (mouseY > height/2){
         angle = constrain(angle - 0.5, -10, 20); 
    }
}



Project-03-Dynamic-Drawing: Section B

My process for this project was to alter basic shapes and colors to create a kaleidoscope. I used transformations so I could draw the same images many times in different locations. Moving the mouse left and right shrinks, enlarges, and repositions different elements. Crossing the horizontal midpoint reverses the rotation. Vertical motion with the mouse speeds and slows the rotation. Clicking changes colors.

From my sketchbook.
sketch
// Evan Stuhlfire
// estuhlfi, section B
// Project-03: Dynamic Drawing

var angle = 0; // Angle to increment for rotation
var angleInc = 2; // Controls speed of rotation
var rotateDir = 1; // Direction of rotation
var centerX; // Center of original canvas
var centerY;
var shapeSpace = 30; // Space between shapes
var rectSize = 20;
var startSize = 10;
var circleStart = 10;
var littleCircle = 10;
var colorScheme = 1; // standard = 1, switched = -1

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

    centerX = width/2;
    centerY = height/2;
}

function draw() {
    background(50);

    // If the mouse is left of center set rotation counterclockwise
    if(mouseX < centerX){
        rotateDir = -1;
    } else {
        rotateDir = 1; // Set rotation clockwise
    }

    // Translate the canvas origin to the center
    translate(centerX, centerY);

    // Save the current settings
    push();

    // Rotate the canvas for the shape redraw
    rotate(radians(angle * rotateDir));

    // Draw background circle
    fill(120, 88, 111);
    stroke(120, 88, 111);
    ellipse(0, 0, height, height);

    // Draw center rectangle
    fill(230, 199, 156);
    stroke(230, 199, 156);
    rectMode(CENTER); // Center rect around (0,0)
    rect(0,0, rectSize, rectSize);
    rect(0, 0, rectSize * mouseX/15, rectSize * mouseX/15);

    // Draw center crossing rectangles
    if(colorScheme == 1){
        fill(123, 158, 168); // grey blue
        stroke(123, 158, 168);
    } else {
        fill(111, 208, 140); // green
        stroke(111, 208, 140);
    }
    
    rect(0, 0, 25, width * 1.5);
    rect(0,0, width * 1.5, 25);

    // Draw little circle
    fill(120, 88, 111);
    stroke(120, 88, 111);
    ellipse(0, 0, littleCircle * mouseX/15, littleCircle * mouseX/15);

    // Draw four spokes of ellipses and diamonds 
    // at 90 degree intervals
    drawEllipse();
    drawRects();
    
    rotate(radians(90));
    drawEllipse();
    drawRects();

    rotate(radians(90));
    drawEllipse();
    drawRects();

    rotate(radians(90));
    drawEllipse();
    drawRects();

    // Return to saved settings
    pop();

    angle = angle + mouseY/100;
}

function drawEllipse(){
    // Set color of ellipses
    if(colorScheme == 1){
        fill(111, 208, 140); // green
        stroke(111, 208, 140);
    } else {
        fill(123, 158, 168); // grey blue
        stroke(123, 158, 168);
    }
    

    var circleSize = circleStart;
    var circleInc = 5;

    circleSize = circleSize * (width - mouseX)/150;
  
    // Draw a line of ellipses
    ellipse(shapeSpace, shapeSpace, circleSize, circleSize);
    // Draw first row dots
    var dotSize = 4;
    push(); // Save settings
    fill(205, 223, 160); // yellow
    stroke(0);
    rect(shapeSpace, shapeSpace, circleSize/dotSize, circleSize/dotSize);
    pop(); // restore settings
    
    circleSize += circleInc;
    ellipse(2 * shapeSpace, 2 * shapeSpace, circleSize, circleSize);
    // Draw second row dots
    push(); // Save settings
    fill(120, 88, 111); // purple
    rect(2 * shapeSpace, 2 * shapeSpace, circleSize/dotSize, circleSize/dotSize);
    pop(); // restore settings

    circleSize += circleInc;
    ellipse(3 * shapeSpace, 3 * shapeSpace, circleSize, circleSize);
    // Draw third row of dots
    push(); // Save settings
    fill(205, 223, 160); // yellow
    stroke(0);
    rect(3 * shapeSpace, 3 * shapeSpace, circleSize/dotSize, circleSize/dotSize);
    pop(); // Restore settings

    circleSize += circleInc;
    ellipse(4 * shapeSpace, 4 * shapeSpace, circleSize, circleSize);
    // Draw fourth row of dots
    push(); // Save settings
    fill(120, 88, 111); // purple
    rect(4 * shapeSpace, 4 * shapeSpace, circleSize/dotSize, circleSize/dotSize);
}

function drawRects(){
    // Draws a line of rectangles 

    // Set color of rectangles
    fill(205, 223, 160); // yellow
    stroke(120, 88, 111); // purple

    // Save current settings
    push();

    // Rotate canvase so rectangles craw as diamonds
    rotate(radians(45));

    rectMode(CENTER); // draw rects from center
    var sqSize = startSize * mouseX/100;
    var sqInc = 5;
    // Draw first rectangle
    rect(shapeSpace, shapeSpace, sqSize, sqSize);

    // Draw second rectangle
    sqSize += sqInc;
    rect(shapeSpace + 2 * sqSize, shapeSpace + 2 * sqSize, sqSize, sqSize);

    // Draw third rectangle
    sqSize += sqInc;
    rect(shapeSpace + 3 * sqSize, shapeSpace + 3 * sqSize, sqSize, sqSize);

    // Draw fourth rectangle
    sqSize += sqInc;
    rect(shapeSpace + 4 * sqSize, shapeSpace + 4 * sqSize, sqSize, sqSize);

    // Draw dots
    stroke(0);
    fill(111, 208, 140); // green
    var dotSize = 3;
    ellipse(shapeSpace + 4 * sqSize, shapeSpace + 4 * sqSize, sqSize/dotSize, 
        sqSize/dotSize);

    // third row dots
    fill(120, 88, 111); // purple
    sqSize -= sqInc; // Set sqSize to third square
    ellipse(shapeSpace + 3 * sqSize, shapeSpace + 3 * sqSize, sqSize/dotSize, 
        sqSize/dotSize);

    // second row dots
    fill(111, 208, 140); // green
    sqSize -= sqInc;
    ellipse(shapeSpace + 2 * sqSize, shapeSpace + 2 * sqSize, sqSize/dotSize, 
        sqSize/dotSize);

    // first row dot
    fill(120, 88, 111); // purple
    ellipse(shapeSpace, shapeSpace, sqSize/dotSize, 
        sqSize/dotSize);

    // Return to saved settings
    pop();
}

function mousePressed(){
    colorScheme = -colorScheme;
}

Project-03-Dynamic-Drawing

-The triangles rotate clockwise when mouse moving to the right, and counterclockwise when moving to the left

-The color become lighter when mouse moving to the bottom right, and darker when moving to the top left

-The triangle and change distance as mouse moving left, and it do the opposite when moving right.

– The smile faces shrink as mouse moves.

sketchDownload
/* Jiayi Chen
   jiayiche    Section A */
function setup() {
     createCanvas(600, 450);
     rectMode(CENTER);
}

function draw() {
    print('mouseX='+ mouseX +'mouseY'+mouseY)
    //change background
    backgroundchange();

    // smile face background
    for (var a=5;a<600;a=a+35){
        for (var b=0;b<450;b=b+35){
        push();
        translate(a,b);
        smileface();
        //change size
        var mx =constrain(mouseX,0,450)
        var my =constrain(mouseY,0,300)
            if(dist(mx,my,a,b)<= 150){ 
                d=30* dist(mx,my,a,b)/150;
            }
        pop();
        } 
    }
    //floating triangle and rectangle
    translate(constrain(mx,0,575),constrain(my,0,425));
    push();
    noStroke()
    cr=mx/450*255
    fill(cr,cr,cr,200)
    rect(0,0,50,50);
    var ang=mouseX/600*360
    //6 triangles
    push();
    scale(3*constrain(my,0,450)/450*3)
    push();
    triDist=100*constrain(mx,0,600)/600
    rotate(radians(ang));
    translate(triDist,0);
    triangle(0, 30, 30, 30, 15, 15);
    pop();
    push();
    rotate(radians(ang+60));
    translate(triDist,0);
    triangle(0, 30, 30, 30, 15, 15);
    pop();
    push();
    rotate(radians(ang+120));
    translate(triDist,0);
    triangle(0, 30, 30, 30, 15, 15);
    pop();
    push();
    rotate(radians(ang+180));
    translate(triDist,0);
    triangle(0, 30, 30, 30, 15, 15);
    pop();
    push();
    rotate(radians(ang+240));
    translate(triDist,0);
    triangle(0, 30, 30, 30, 15, 15);
    pop();
    push();
    rotate(radians(ang+300));
    translate(triDist,0);
    triangle(0, 30, 30, 30, 15, 15);
    pop();
    pop();
    pop();
}



var x=16
var y=16
var d=30



//single simle face
function smileface(){
    push();
    fill('yellow')
    //head
    ellipse(x,y,d); 
    //mouth
    arc(x, y+d*1/7, d/2, d/2, 0, PI); 
    //eye
    fill(0)
    ellipse(x+d*1/5,y-d*1/5,d/6);
    ellipse(x-d*1/5,y-d*1/5,d/6);
    pop();
}


   //change in background
function backgroundchange(){
    var r = mouseX/600*255
    var g = mouseX/600*255
    var b = mouseY/600*255
    background(r,g,b)
}

Project 3

sketch
//Paul Li
//Section A



var backR = 10;
var backG = 10;
var backB = 10;
var w = 30;
var h = 20;
var triR = 30;
var triG = 40;
var x = 1;


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

function draw() {

    //background & color
    //background color changes based on mouse
        backR = max(min(mouseY/2,255),0);
        backG = max(min(mouseX/2.2,255),0);
        backB = max(min(mouseX,255),0);
        background(backR,backG,backB,mouseY/60)
    //shape & shape movement
    // stroke weight and width and height of the ellipse is determined by mouse position
    // 
        w = min(mouseY,width - 30);
        h = min(mouseX,height - 30);
        strokeWeight(mouseX/100+mouseY/100);
        stroke(backG,backR,backB);
        fill(backG,backR,backB);
        ellipse(width/2,height/2, w, h);
//triangles rotate and move according to mouse cordinates in inverse and direct relationships
        push();
        rotate(radians(min(mouseX,width)));
        fill(backB,backR,backB);
        triangle(
            constrain(mouseX/(mouseY/30),0,width),mouseY,
            constrain(mouseY/(mouseX/30),0,width-50),mouseY,
            mouseX,mouseY
            );
        pop();
// chnaging color by mouse position.
        push();
        triR = constrain(mouseX,0,width);
        triG = constrain(mouseY, 0, height);
        translate(width/2,height/2);
        rotate(radians(min(mouseY,height)));
        fill(triR,triG,0);
        triangle(
            constrain(mouseY/(mouseX/10),0,width),mouseY,
            constrain(mouseX/(mouseY/10),0,width-100),mouseY,
            mouseX,mouseY
            );
       
        pop();


// square in the center & moving squares.
        fill(0,0,0,60);
        stroke(backG/2,backR,backB)
        square(width/2,height/2,height/min(mouseX/100,mouseY/30));
        push();
        translate(50,50);
        rotate(radians(x));
        x+= 4;
        fill(255);
        rect(width/2,height/2,constrain(mouseX,0,100),constrain(mouseY,0,50));
        pop();

        push();
        translate(width,50);
        rotate(radians(x));
        x+=4;
        fill(255);
        rect(width/2,height/2,constrain(mouseX,0,50),constrain(mouseY,0,20));
        pop();

        strokeWeight(2);
        stroke(255-backG/2,255-backR,255-backB)
        line(mouseX,mouseY,width/2,height/2);



        //frameRate(400);


    //scaling

      //  }
   // }
}