LAPORAN MATA KULIAH GRAFIKA KOMPUTER PROGRAM STUUDI D-IV TEKNIK MULTIMEDIA DAN JARINGAN JURUSAN TEKNIK ELEKTRO POLITEKNIK NEGERI UJUNG PANDANG Nama NIM Kelas Judul Percobaan
: Andi Bella Shafira : 426 17 006 : 2A : Membuat Sepeda Menggunakan Pemrograman Line, Rectangle, dan Circle.
Hasil Percobaan :
Source Code : #include int main() { initwindow(1230,700); for(int i=0; i<1230; i++) { setcolor(DARKGRAY); line(0,510,1300,510); //road line (155+i,370,350+i,350); line (157+i,410,350+i,430); line (350+i,390,430+i,390); //pedal; setcolor(LIGHTCYAN);
line (620+i,370,540+i,90); line(540+i,90,575+i,75); line (560+i,35,575+i,75); line (450+i,80,560+i,35); line (542+i,70,550+i,88); line (440+i,115,542+i,70); line (319+i,300,576+i,210); line (382+i,369,582+i,238); line (270+i,200,340+i,350);
setcolor(LIGHTCYAN); rectangle (230+i,170,320+i,200); setfillstyle(SOLID_FILL,LIGHTCYAN); floodfill(231+i,171,LIGHTCYAN); setcolor(LIGHTCYAN); rectangle (430+i,380,480+i,400); setfillstyle(SOLID_FILL,LIGHTCYAN); floodfill(431+i,381,LIGHTCYAN); setcolor(DARKGRAY); circle (150+i,390,120); //ban setfillstyle(SOLID_FILL,DARKGRAY); floodfill(151+i,391,DARKGRAY);
setcolor(DARKGRAY); circle (350+i,390,40); //gear setfillstyle(SOLID_FILL,DARKGRAY); floodfill(351+i,391,DARKGRAY);
setcolor(DARKGRAY); circle (620+i,390,120); //ban setfillstyle(SOLID_FILL,DARKGRAY); floodfill(621+i,391,DARKGRAY);
setcolor(LIGHTRED); circle (150+i,390,20); //circle dalam ban setfillstyle(SOLID_FILL,LIGHTRED); floodfill(151+i,391,LIGHTRED);
setcolor(LIGHTRED); circle (620+i,390,20); //circle dlm ban setfillstyle(SOLID_FILL,LIGHTRED); floodfill(621+i,391,LIGHTRED);
//lAMPU setcolor(YELLOW); circle (565+i,120,15); setfillstyle(SOLID_FILL,YELLOW); floodfill(567+i,121,YELLOW); //KERANJANG setcolor(BROWN); rectangle (595+i,170,720+i,268); setfillstyle(HATCH_FILL,BROWN); floodfill(596+i,171,BROWN); delay(10); cleardevice(); } getch(); } Analisa Percobaan :