Assalamu'alaikum Wr.Wb Teman Mahasiswa ,
Hai teman mahasiswa apa kabar semua ? semoga sehat selalu yaa dan selalu dilindungi oleh Allah SWT, amiinn :)
Kali ini kita akan membuat sebuah Animasi bergerak seorang manusia mengendarai motor menggunakan Processing. ( waduh judul nya panjang amat bang wkwk :D ).
Baca juga :( Membuat Animasi Bergerak Perkotaan serta Lalu Lintas Menggunakan Processing )
Tanpa berlama-lama, berikut koding membuat animasi bergerak manusia mengendarai sebuah motor menggunakan processing ;
//Membuat Animasi Bergerak Seorang Manusia Mengendarai Sebuah Motor
//Catatans Mahasiswa :)
void setup()
{
size(900,500);
}
void draw(){
background(#0AB3FF);
int d;
d=second();
//matahari
ellipse(10+3*d,45,90,90);
//gedung
noStroke();
fill(#9395AF);
rect(135,200,200,220);
rect(95,160,80,240);
rect(0,200,120,200);
rect(670,205,90,210);
rect(750,210,100,230);
rect(800,160,100,250);
//Jendela
fill(#FFFFFF);
rect(19,250,20,40);
rect(59,250,20,40);
rect(105,200,20,40);
rect(145,200,20,40);
rect(105,300,20,40);
rect(145,300,20,40);
rect(240,250,20,40);
rect(280,250,20,40);
rect(240,350,20,40);
rect(280,350,20,40);
rect(680,350,20,40);
rect(730,350,20,40);
rect(680,250,20,40);
rect(730,250,20,40);
rect(790,250,20,40);
rect(820,250,20,40);
rect(790,350,20,40);
rect(820,350,20,40);
rect(870,250,20,40);
rect(870,350,20,40);
//Jalan
fill(#0A0A0A);
rect(0,400,900,900);
fill(#FAFAFA);
rect(10,450,20,5);
rect(60,450,20,5);
rect(110,450,20,5);
rect(160,450,20,5);
rect(210,450,20,5);
rect(260,450,20,5);
rect(310,450,20,5);
rect(360,450,20,5);
rect(410,450,20,5);
rect(460,450,20,5);
rect(510,450,20,5);
rect(560,450,20,5);
rect(610,450,20,5);
rect(660,450,20,5);
rect(710,450,20,5);
rect(760,450,20,5);
rect(810,450,20,5);
rect(860,450,20,5);
//motor
fill(#FCFDFF);
ellipse (10+10*d,450,30,30);
ellipse(100+10*d,450,30,30);
fill(#0C0D0C);
ellipse (10+10*d,450,10,10);
ellipse(100+10*d,450,10,10);
fill(#FCFDFF);
ellipse(105+10*d,415,7,15);
fill(#0319FF);
rect(97+10*d,410,7,40);
fill(#0319FF);
ellipse(23+10*d,418,50,15);
rect(10+10*d,410,7,25);
fill(#FCFDFF);
ellipse (73+10*d,415,50,25);
//orang
fill(255,205,155);
ellipse(38+10*d,370,18,18);
fill(100,20,10);
arc(38+10*d,370,18,18,(180*PI)/360,(360*PI)/180);
fill(100,20,255);
arc(38+10*d,390,18,18,(180*PI)/180,(360*PI)/180);
rect(30+10*d,390,18,18);
fill(255,305,155);
rect(30+10*d,395,30,5);
}
//Catatans Mahasiswa :)
void setup()
{
size(900,500);
}
void draw(){
background(#0AB3FF);
int d;
d=second();
//matahari
ellipse(10+3*d,45,90,90);
//gedung
noStroke();
fill(#9395AF);
rect(135,200,200,220);
rect(95,160,80,240);
rect(0,200,120,200);
rect(670,205,90,210);
rect(750,210,100,230);
rect(800,160,100,250);
//Jendela
fill(#FFFFFF);
rect(19,250,20,40);
rect(59,250,20,40);
rect(105,200,20,40);
rect(145,200,20,40);
rect(105,300,20,40);
rect(145,300,20,40);
rect(240,250,20,40);
rect(280,250,20,40);
rect(240,350,20,40);
rect(280,350,20,40);
rect(680,350,20,40);
rect(730,350,20,40);
rect(680,250,20,40);
rect(730,250,20,40);
rect(790,250,20,40);
rect(820,250,20,40);
rect(790,350,20,40);
rect(820,350,20,40);
rect(870,250,20,40);
rect(870,350,20,40);
//Jalan
fill(#0A0A0A);
rect(0,400,900,900);
fill(#FAFAFA);
rect(10,450,20,5);
rect(60,450,20,5);
rect(110,450,20,5);
rect(160,450,20,5);
rect(210,450,20,5);
rect(260,450,20,5);
rect(310,450,20,5);
rect(360,450,20,5);
rect(410,450,20,5);
rect(460,450,20,5);
rect(510,450,20,5);
rect(560,450,20,5);
rect(610,450,20,5);
rect(660,450,20,5);
rect(710,450,20,5);
rect(760,450,20,5);
rect(810,450,20,5);
rect(860,450,20,5);
//motor
fill(#FCFDFF);
ellipse (10+10*d,450,30,30);
ellipse(100+10*d,450,30,30);
fill(#0C0D0C);
ellipse (10+10*d,450,10,10);
ellipse(100+10*d,450,10,10);
fill(#FCFDFF);
ellipse(105+10*d,415,7,15);
fill(#0319FF);
rect(97+10*d,410,7,40);
fill(#0319FF);
ellipse(23+10*d,418,50,15);
rect(10+10*d,410,7,25);
fill(#FCFDFF);
ellipse (73+10*d,415,50,25);
//orang
fill(255,205,155);
ellipse(38+10*d,370,18,18);
fill(100,20,10);
arc(38+10*d,370,18,18,(180*PI)/360,(360*PI)/180);
fill(100,20,255);
arc(38+10*d,390,18,18,(180*PI)/180,(360*PI)/180);
rect(30+10*d,390,18,18);
fill(255,305,155);
rect(30+10*d,395,30,5);
}
Jangan lupa semua koding nya di copy-paste dan silahkan "Run" . :)
Jika ada kesalahan atau kekurangan dalam penyampaian tutorial maupun perkataan yang kurang jelas, kami mohon maaf sebesar-besarnya.
Jika ada kesalahan atau kekurangan dalam penyampaian tutorial maupun perkataan yang kurang jelas, kami mohon maaf sebesar-besarnya.
Jika ada kekurangan, jangan sungkan untuk berkomentar yaa.
Komentar kalian sangat berarti bagi perkembangan Blog ini , Terima kasih .. :)
Jangan lupa di share yaa :D wkwk
#Salam Teman Mahasiswa
Selamat mencoba dan semoga berhasil ;)
Disini saya menggunakan Processing 2.2.1 .
Untuk Aplikasi Processing nya bisa di ( Download Disini :) )
Untuk Aplikasi Processing nya bisa di ( Download Disini :) )
Wassalamu'alaikum wr.wb
1 komentar :
Click here for komentarBg kalau membuat pesawat bagaimana bg..kami sudah mencari-cari caranya bg
ConversionConversion EmoticonEmoticon