Mengambar Object Sederhana Dengan Aplikasi Processing Latihan 2
Friday, February 22, 2019
Add Comment
hpk
Jika dilatihan 1 kita membuat program sederhana dengan processing yaitu berupa object lingkaran yang bisa membuat gambar, dan pada kesempatan kali ini sekaligus sebagai latihan 2 yaitu membuat object sederhana menggunakan aplikasi processing, jika masih ada yang belum tau mengenai aplikasi processing ini silahkan baca lagi pada artikel yang berjudul : Membuat Program Sederhana Dengan Aplikasi Processing Latihan 1 disana ada penjelasan singkat mengenai penggunaan processing.
Sebagai referensi kalian berikut saya mempunyai beberapa script code untuk program sederhana procesing dalam membuat object. berikut scriptnya :
1. Mengambar Object Spongebob
size(430,455);
//backround
int l=width;
int t=height;
background(#F22A2A);
fill(#4AAAFC);
quad(l/2,0, l,t/2, l/2,t, 0,t/2);
fill(#F8FC30);
quad(l/2,0+t/8*1, l-l/8*1,t/2, l/2,t-t/8*1, 0+l/8*1,t/2);
fill(#69BC11);
quad(l/2,0+t/8*2, l-l/8*2,t/2, l/2,t-t/8*2, 0+l/8*2,t/2);
//badan
fill(#FFE40F);
rect(110,150,200,120);
fill(#FFFFFF);
rect(110,150,200,160);
fill(#F0E02E);
rect(110,150,200,120);
//celana
fill(#836309);
rect(110,310, 90, 50);
rect(220,310, 90, 50);
//kaki
fill(#FFE40F);
rect(140, 360, 30, 90);
rect(250, 360, 30, 90);
//sepatu
noStroke();
fill(#080808);
rect(110,420,60,30);
ellipse(127,435,50,40);
fill(#FFFFFF);
ellipse(110,430,10,10);
fill(#080808);
rect(250,420,50,30);
ellipse(290,435,50,40);
fill(#FFFFFF);
ellipse(305,430,10,10);
//mata
stroke(10);
ellipse(170,200,40,40);
ellipse(250,200,40,40);
//mata kecil
fill(#347DD8);
ellipse(175,200,20,20);
ellipse(245,200,20,20);
fill(#080808);
ellipse(175,200,10,10);
ellipse(245,200,10,10);
//bibir
noFill();
arc(210,230,100,50, (0*PI)/180,(180*PI)/180);
//gigi
fill(#FFFFFF);
rect(200,255,10,10);
rect(210,255,10,10);
//hidung
fill(#F0D400);
arc(210,220,10,30, (0*PI)/180,(180*PI)/180);
//dasi
fill(#D30202);
ellipse(230,290,30,20);
ellipse(190,290,30,20);
fill(#050505);
noStroke();
ellipse(210,290,20,20);
//tangan
stroke(5);
fill(#FFFFFF);
rect(85,260,25,30);
rect(310,260,25,30);
fill(#FFE40F);
rect(90,290,10,50);
rect(319,290,10,50);
ellipse(95,340,30,30);
ellipse(325,340,30,30);
//Alis
stroke(#0F0101);
strokeWeight(3);
line(155,187, 145,170);
line(165,180, 165,165);
line(179,181, 184,165);
line(240,183, 230, 167);
line(250,179, 250, 162);
line(262,183, 275,170);
//text
fill(#000000);
text("Nama : Teknoowl", 10,50);
text("Kelas : Teknik Informatika", 10,65);
text("Gambar Patrick", 10,80);
//backround
int l=width;
int t=height;
background(#F22A2A);
fill(#4AAAFC);
quad(l/2,0, l,t/2, l/2,t, 0,t/2);
fill(#F8FC30);
quad(l/2,0+t/8*1, l-l/8*1,t/2, l/2,t-t/8*1, 0+l/8*1,t/2);
fill(#69BC11);
quad(l/2,0+t/8*2, l-l/8*2,t/2, l/2,t-t/8*2, 0+l/8*2,t/2);
//badan
fill(#FFE40F);
rect(110,150,200,120);
fill(#FFFFFF);
rect(110,150,200,160);
fill(#F0E02E);
rect(110,150,200,120);
//celana
fill(#836309);
rect(110,310, 90, 50);
rect(220,310, 90, 50);
//kaki
fill(#FFE40F);
rect(140, 360, 30, 90);
rect(250, 360, 30, 90);
//sepatu
noStroke();
fill(#080808);
rect(110,420,60,30);
ellipse(127,435,50,40);
fill(#FFFFFF);
ellipse(110,430,10,10);
fill(#080808);
rect(250,420,50,30);
ellipse(290,435,50,40);
fill(#FFFFFF);
ellipse(305,430,10,10);
//mata
stroke(10);
ellipse(170,200,40,40);
ellipse(250,200,40,40);
//mata kecil
fill(#347DD8);
ellipse(175,200,20,20);
ellipse(245,200,20,20);
fill(#080808);
ellipse(175,200,10,10);
ellipse(245,200,10,10);
//bibir
noFill();
arc(210,230,100,50, (0*PI)/180,(180*PI)/180);
//gigi
fill(#FFFFFF);
rect(200,255,10,10);
rect(210,255,10,10);
//hidung
fill(#F0D400);
arc(210,220,10,30, (0*PI)/180,(180*PI)/180);
//dasi
fill(#D30202);
ellipse(230,290,30,20);
ellipse(190,290,30,20);
fill(#050505);
noStroke();
ellipse(210,290,20,20);
//tangan
stroke(5);
fill(#FFFFFF);
rect(85,260,25,30);
rect(310,260,25,30);
fill(#FFE40F);
rect(90,290,10,50);
rect(319,290,10,50);
ellipse(95,340,30,30);
ellipse(325,340,30,30);
//Alis
stroke(#0F0101);
strokeWeight(3);
line(155,187, 145,170);
line(165,180, 165,165);
line(179,181, 184,165);
line(240,183, 230, 167);
line(250,179, 250, 162);
line(262,183, 275,170);
//text
fill(#000000);
text("Nama : Teknoowl", 10,50);
text("Kelas : Teknik Informatika", 10,65);
text("Gambar Patrick", 10,80);
2. Mengambar Object Doraemon
size (600,600);
background(5,249,74);
strokeWeight(10);
stroke(248,67,71);
line(0,420,420,0);
strokeWeight(10);
stroke(88,67,248);
line(0,480,480,0);
strokeWeight(10);
stroke(244,214,14);
line(0,540,540,0);
strokeWeight(10);
stroke(196,6,224);
line(0,600,600,0);
//kepala
strokeWeight(3);
fill(0,0,255);
stroke(0,0,0);
arc(350,250,250,255,(130*PI)/180,(410*PI)/180);
fill(255,255,255);
arc(350,270,210,200,(130*PI)/180,(410*PI)/180);
fill(255,255,255);
noStroke();
rect(283,300,135,50);
//mata kiri
fill(255,255,255);
stroke(0,0,0);
ellipse (330,170, 50, 60);
fill(0,0,0);
strokeWeight(15);
point(340,185);
//mata kanan
strokeWeight(3);
fill(255,255,255);
ellipse (385,170, 50, 60);
fill(0,0,0);
strokeWeight(15);
point(375,185);
strokeWeight(3);
fill(255,0,0); //hidung
ellipse(357,200,25,20);
line(356,210,356,245);
//mulut
arc(350,245,140,180,(0*PI)/180,(180*PI)/180);
arc(350,325,140,115,(215*PI)/180,(325*PI)/180);
line(280,245,420,245);
//kumis kiri
line(330,210,290,200);
line(330,220,290,210);
line(330,230,290,220);
//kumis kanan
line(378,210,418,200);
line(378,220,418,210);
line(378,230,418,220);
//tangan kiri
fill(0,0,255);
strokeWeight(3);
stroke(0,0,0);
ellipse(240,390,40,100);
//telapak kiri
fill(255,255,255);
ellipse(240,440,40,40);
//tangan kanan
fill(0,0,255);
strokeWeight(3);
stroke(0,0,0);
ellipse(460,390,40,100);
//telapak kanan
fill(255,255,255);
ellipse(460,440,40,40);
//badan
fill(0,0,255);
stroke(0,0,0);
strokeWeight(3);
rect(255,350,190,150);
//leher
strokeWeight(9);
stroke(255,0,0);
line(255,345,445,345);
//perut
fill(255,255,255);
strokeWeight(3);
stroke(0,0,0);
arc(350,395,160,170,(330*PI)/180,(570*PI)/180);
noStroke();
rect(283,352,135,50);
//lonceng
fill(255,255,0);
strokeWeight(3);
stroke(0,0,0);
ellipse(350,358,25,25);
ellipse(350,365,10,10);
arc(350,356,25,10,(180*PI)/180,(360*PI)/180);
arc(350,360,25,10,(180*PI)/180,(360*PI)/180);
//kantong
fill(255,255,255);
strokeWeight(3);
stroke(0,0,0);
arc(350,390,140,150,(0*PI)/180,(180*PI)/180);
line(280,390,420,390);
//garis kaki
fill(0,0,255);
arc(340,490,30,20,(280*PI)/180,(420*PI)/180);
//kaki
fill(255,255,255);
ellipse(410,520,120,50);
ellipse(290,520,120,50);
fill(#000000);
text("Nama : Teknoowl", 10,50);
text("Kelas : Teknik Informatika", 10,65);
text("Gambar Jayen", 10,80);
background(5,249,74);
strokeWeight(10);
stroke(248,67,71);
line(0,420,420,0);
strokeWeight(10);
stroke(88,67,248);
line(0,480,480,0);
strokeWeight(10);
stroke(244,214,14);
line(0,540,540,0);
strokeWeight(10);
stroke(196,6,224);
line(0,600,600,0);
//kepala
strokeWeight(3);
fill(0,0,255);
stroke(0,0,0);
arc(350,250,250,255,(130*PI)/180,(410*PI)/180);
fill(255,255,255);
arc(350,270,210,200,(130*PI)/180,(410*PI)/180);
fill(255,255,255);
noStroke();
rect(283,300,135,50);
//mata kiri
fill(255,255,255);
stroke(0,0,0);
ellipse (330,170, 50, 60);
fill(0,0,0);
strokeWeight(15);
point(340,185);
//mata kanan
strokeWeight(3);
fill(255,255,255);
ellipse (385,170, 50, 60);
fill(0,0,0);
strokeWeight(15);
point(375,185);
strokeWeight(3);
fill(255,0,0); //hidung
ellipse(357,200,25,20);
line(356,210,356,245);
//mulut
arc(350,245,140,180,(0*PI)/180,(180*PI)/180);
arc(350,325,140,115,(215*PI)/180,(325*PI)/180);
line(280,245,420,245);
//kumis kiri
line(330,210,290,200);
line(330,220,290,210);
line(330,230,290,220);
//kumis kanan
line(378,210,418,200);
line(378,220,418,210);
line(378,230,418,220);
//tangan kiri
fill(0,0,255);
strokeWeight(3);
stroke(0,0,0);
ellipse(240,390,40,100);
//telapak kiri
fill(255,255,255);
ellipse(240,440,40,40);
//tangan kanan
fill(0,0,255);
strokeWeight(3);
stroke(0,0,0);
ellipse(460,390,40,100);
//telapak kanan
fill(255,255,255);
ellipse(460,440,40,40);
//badan
fill(0,0,255);
stroke(0,0,0);
strokeWeight(3);
rect(255,350,190,150);
//leher
strokeWeight(9);
stroke(255,0,0);
line(255,345,445,345);
//perut
fill(255,255,255);
strokeWeight(3);
stroke(0,0,0);
arc(350,395,160,170,(330*PI)/180,(570*PI)/180);
noStroke();
rect(283,352,135,50);
//lonceng
fill(255,255,0);
strokeWeight(3);
stroke(0,0,0);
ellipse(350,358,25,25);
ellipse(350,365,10,10);
arc(350,356,25,10,(180*PI)/180,(360*PI)/180);
arc(350,360,25,10,(180*PI)/180,(360*PI)/180);
//kantong
fill(255,255,255);
strokeWeight(3);
stroke(0,0,0);
arc(350,390,140,150,(0*PI)/180,(180*PI)/180);
line(280,390,420,390);
//garis kaki
fill(0,0,255);
arc(340,490,30,20,(280*PI)/180,(420*PI)/180);
//kaki
fill(255,255,255);
ellipse(410,520,120,50);
ellipse(290,520,120,50);
fill(#000000);
text("Nama : Teknoowl", 10,50);
text("Kelas : Teknik Informatika", 10,65);
text("Gambar Jayen", 10,80);
3. Mengambar Object Ulat
void setup(){
size(540,540);
background(#4AAAFC);
}
void draw(){
fill(#000000);
text("Nama : Teknoowl", 10,400);
text("Kelas : Teknik Informatika", 10,415);
text("Gambar Kecebong", 10,430);
fill(255,241,111);
stroke(0,0,0);
ellipse(450,480,100,100);
fill(255,241,111);
stroke(0,0,0);
ellipse(430,400,150,150);
fill(255,241,111);
stroke(0,0,0);
ellipse(400,300,200,200);
//muka dasar
fill(255,235,8);
stroke(0,0,0);
ellipse(300,150,400,400);
//alis
strokeWeight(10);
stroke(10,114,255);
line(100,40,200,40);
line(300,40,400,40);
//matakotak
fill(255,255,255);
noStroke();
rect(100,50,100,50);
fill(255,255,255);
noStroke();
rect(300,50,100,50);
//hidung
fill(255,255,255);
noStroke();
ellipse(200,150,100,50);
//mata bulat
fill(0,0,0);
ellipse(150,75,50,50);
fill(0,0,0);
ellipse(350,75,50,50);
//mulut
fill(255,0,0);
arc(275,225,200,200,0,PI);
//sungut
fill(255,0,0);
arc(240,160,50,50,1, PI/2);
arc(160,160,50,50,1,PI/2);
}
size(540,540);
background(#4AAAFC);
}
void draw(){
fill(#000000);
text("Nama : Teknoowl", 10,400);
text("Kelas : Teknik Informatika", 10,415);
text("Gambar Kecebong", 10,430);
fill(255,241,111);
stroke(0,0,0);
ellipse(450,480,100,100);
fill(255,241,111);
stroke(0,0,0);
ellipse(430,400,150,150);
fill(255,241,111);
stroke(0,0,0);
ellipse(400,300,200,200);
//muka dasar
fill(255,235,8);
stroke(0,0,0);
ellipse(300,150,400,400);
//alis
strokeWeight(10);
stroke(10,114,255);
line(100,40,200,40);
line(300,40,400,40);
//matakotak
fill(255,255,255);
noStroke();
rect(100,50,100,50);
fill(255,255,255);
noStroke();
rect(300,50,100,50);
//hidung
fill(255,255,255);
noStroke();
ellipse(200,150,100,50);
//mata bulat
fill(0,0,0);
ellipse(150,75,50,50);
fill(0,0,0);
ellipse(350,75,50,50);
//mulut
fill(255,0,0);
arc(275,225,200,200,0,PI);
//sungut
fill(255,0,0);
arc(240,160,50,50,1, PI/2);
arc(160,160,50,50,1,PI/2);
}
Mungkin dengan 3 buah contoh script gambar diatas bisa menjadikan referensi kalian untuk membuat object gambar lainnya juga pada software processing, selamat mencoba.
the cheapest car insurance
cost of car insurance
best car insurance quotes
insurance auto
insurance quotes car
get car insurance quotes online
car insurance agent
instant car insurance quote
car insurance websites
direct car insurance
insure a car
motor car insurance quote
cheap car insurance
online quotes for car insurance
car insurers
commercial car insurance
motor insurance quote
car insurance quotes online
get a quote online
international health insurance
compare car insurance quotes
insurance for car
compare car insurance
car insurance
buy life insurance online
compare auto insurance
international medical insurance
general car insurance
cheap motor insurance
low car insurance
car insurance comparison
company car insurance
budget car insurance
private health insurance
online quote car insurance
cheap motor car insurance
car insurance for new drivers
cheap car insurance quotes online
online car insurance quotes
get car insurance quotes
car insurance quotes comparison
motor car insurance
car insurance quotes
car insurance cheap
comprehensive car insurance
best auto insurance
short term health insurance
motor insurance
cheap online car insurance
online motor insurance quotes
car insurance california
buycarinsurance
online vehicle insurance
free car insurance quotes
landlord insurance
health insurance for children
motorbike insurance
monthly car insurance
car insurance usa
car insurance reviews
car insurance renewal quotes
vehicle insurance
health insurance rates
term life insurance quotes
vehicle insurance quotes
car insurance compare
motor vehicle insurance
best car insurance
motor insurance online quote
car insurance online quote
life insurance online
supplemental health insurance
best car insurance rates
car insurance discounts
motor vehicle insurance quotes
auto insurance
cheap travel insurance
bike insurance
travel medical insurance
buy car insurance online
online motor insurance
travel insurance quote
get a quote for car insurance
health insurance agent
car insurance companies
cheap car insurance companies
travel insurance
annual travel insurance
commercial vehicle insurance
permanent life insurance
medical insurance quotes
online car insurance
cheap car insurance quotes
car insurance online
quote insurance online
level term life insurance
health insurance comparison
how much is car insurance
travel health insurance
pet health insurance
quotes on cars
health ins
travel insurance uk
quote for car insurance
get insurance quote online
disability insurance quote
temporary health insurance
temporary insurance
rental car insurance
cheap health insurance
auto insurance compare
third party car insurance
buy health insurance
auto insurance quotes
cheap insurance companies
best term life insurance
personal health insurance
online quote insurance
car insurance premium
health insurance policies
quotes for cars
whole life insurance
credit insurance
cheap van insurance
cheap term life insurance
cheap motorcycle insurance
compare life insurance
car insurance cover
health insurance
motorcycle insurance
short term car insurance
health insurance coverage
insurance qoute
cheap life insurance
house insurance quote
car insurance uk
health insurance companies
cigna health insurance
cheap insurance
cheap car insurance uk
compare health insurance
car insurance for young drivers
short term insurance
online health insurance
caravan insurance
life insurance comparison
direct insurance
health insurance plans
motor insurance online
car insurance estimator
accident insurance
home insurance quotes
nj car insurance
new car insurance
private medical insurance
home insurance
car insurance brokers
car insurance rates
commercial insurance
health insurance quotes
motor insurance companies
which car insurance
car quotes online
online auto insurance
flood insurance
cheap auto insurance quotes
car insurance agencies
business health insurance
term life insurance
truck insurance
professional indemnity insurance
life insurance
car insurance policy
long term care insurance
drive insurance
buy insurance
car ins
motorcycle insurance quote
critical illness insurance
term insurance
student health insurance
home insurance comparison
insurance rates
insurance cover
holiday insurance
insurance sites
online vehicle insurance quotes
company website
home insurance rates
compare insurance
buy insurance online
affordable medical insurance
car insurance coverage
product liability insurance
home contents insurance
buy life insurance
renters insurance
group health insurance
family health insurance
motor insurance quote online
mortgage insurance
best home insurance
personal insurance
medical insurance
property insurance
life insurance agent
group insurance
aetna health insurance
cheap medical insurance
liability insurance
rental insurance
life insurance policy
group life insurance
general liability insurance
insurance quotes online
all car insurance companies
best health insurance
insurance plans
life insurance for seniors
van insurance
website quote
universal life insurance
building insurance
co insurance
insurance car
car insurance prices
disability insurance
insurance vehicle
cheap vehicle insurance
senior life insurance
medical insurance plans
insurance health
house insurance
life insurance quotes
car quotes
cheap home insurance
0 Response to "Mengambar Object Sederhana Dengan Aplikasi Processing Latihan 2"
Post a Comment