[INTRO2ICM] WK1 P5JS CANVAS

SKETCH http://doyoki.com/project/icm/icm_week1/

 
Codes that I used:

function setup() {
createCanvas(1000,700);
background(230,230,255);
//ground
fill(50,20,130);
rect(0,500,1000,500);
stroke(255,255,255);
strokeWeight(50);
line(100,500,-300,700);
line(700,500,400,700);

strokeWeight(0);
fill(230,230,255);
rect(0,0,1000,500);
//tyre
fill(1,1,1);
strokeWeight(20);
stroke(70,0,70);
ellipse(600,400,80,200);
ellipse(800,400,80,200);

//Wheelcap
fill(255);
strokeWeight(1);
stroke(150);
ellipse(600,400,24,80);
ellipse(800,400,24,80);
noFill();

//window
strokeWeight(20);
stroke(70,0,70);
fill(0,255,100);
curve(1000,1000,610,270,720,250,1100,900);
curve(100,1200,340,250,610,270,600,1000);
curve(0,400,610,270,720,250,1000,100);
curve(500,-0,340,250,610,270,610,200);

//bottomline1
strokeWeight(20);
stroke(70,0,70);
line(635,500,770,500);

//bottomline2
strokeWeight(20);
stroke(70,0,70);
line(130,500,570,500);

//bonnetline
strokeWeight(20);
stroke(70,0,70);
noFill();
curve(300,1000,120,320,350,270,200,500);
curve(300,500,460,270,550,270,500,500);

//frontbumperline
strokeWeight(20);
stroke(70,0,70);
curve(400,400,120,330,120,500,500,200);
curve(170,170,230,330,430,330,500,200);

//butt
strokeWeight(20);
stroke(70,0,70);
noFill();
arc(830,370,100,250,0,HALF_PI);

//windshield
strokeWeight(20);
stroke(70,0,70);
noFill();
curve(300,400,320,250,450,130,500,200);

//roofline
strokeWeight(20);
stroke(70,0,70);
noFill();
curve(100,600,450,130,740,280,-100,600);

//rearfender
strokeWeight(20);
stroke(70,0,70);
noFill();
curve(200,800,740,280,870,350,700,500);

//rearwing
fill(100,00,100);
stroke(70,0,70);
strokeWeight(15);
line(830,250,830,230);
strokeWeight(10);
quad(740,200,880,200,870,230,770,230);

//airintakelines
strokeWeight(15);
stroke(70,0,70);
fill(100,0,100);
quad(700,320,730,310,720,360,690,400);
strokeWeight(20);
noFill();
curve(140,-300,140,300,250,470,250,1500);
curve(400,1600,380,470,540,300,500,-300);

//airintake
strokeWeight(10);
fill(100,0,100);
rect(110, 370, 100, 100, 20, 50, 10, 15);
rect(415, 370, 100, 100, 50, 20, 15, 10);

//wheel2
stroke(0,100,255);
strokeWeight(20);
point(600,330);
point(800,330);
point(600,470);
point(800,470);
point(620,370);
point(620,430);
point(580,370);
point(580,430);
point(820,370);
point(820,430);
point(780,370);
point(780,430);

//light
fill(230,255,0);
strokeWeight(15);
stroke(70,0,70);
ellipse(180,300,70,70);
ellipse(500,300,70,70);

colorMode(RGB,100);
for(a=0;a<100;a++){
for(b=0;b<100;b++){
stroke(0,b,a);
line(a,b,180,300);
}}
colorMode(RGB,100);
for(c=0;c<100;c++){
for(d=0;d<100;d++){
stroke(c,0,d);
line(320+c,d,500,300);
}}

}

function draw() {

}

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