Make an image

//
//Make a picture with shapes at least 25.
//


var mousex;
var mousey;
var pmousex;
var pmousey;

var flipper = 1;
var flexThresh = 50;
var flex = -flexThresh;

function setup() 
{
 //
 createCanvas(1000,1000);

 
}

function draw() 
{
 background(50);
 fill(100,0,0, 5);
 rect(0,0, width, height);
 var cx = width/2;
 var cy = height/2;
 strokeWeight(1);
 stroke(0,100,255);
 noFill();
 
 if(flex > flexThresh*2 || flex < -flexThresh)
 flipper = flipper*-1;
 
 flex = flex + 1*flipper;




 for(var i = 0-200; i <height+200; i)
 {
 bezier(0, i, cx/2, i + flex, cx+cx/2, i+flex, width, i);
 i = i+10;
 }
 
 for(var i = 0-200; i < width+200; i)
 {
 bezier(i, 0, i+flex, cy/2, i + flex, cy+cy/2, i, height);
 i = i +10;
 }
 
 
 for(var i = 100; i < height; i)
 {
 line(cx-i, cy+i+flex, cx+i, cy+i-flex);
 line(cx-i, cy+i-flex, cx+i, cy+i+flex);
 i = i + 10;
 }
 
 for(var i = 0; i < cy - 100; i)
 {
 line(0+i, i+flex, width-i, i-flex);
 line(0+i, i-flex, width-i, i+flex);
 i = i + 10;
 }

 for(var i = 0; i < cx-100; i)
 {
 line(i, height-i+flex, i, i+flex);
 line(i, height-i-flex, i, i-flex);
 i = i + 10;
 }
 
 for(var i = 0; i < cx; i)
 {
 line(i+cx+100, cy-i-flex-100, i+cx+100, cy+i-flex+100);
 line(i+cx+100, cy-i+flex+100, i+cx+100, cy+i+flex-100);
 i = i+ 10;
 }
 

 for(var i = cy-50; i < cy + 50;i)
 {
 line(0, i, width, i);
 i = i+5;
 }
 
 for(var i = -200; i <width + 200; i)
 {
 line(i, cy-50-flex, i+200, cy+50+flex);
 i = i +5;
 }
}
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s