Desain Dalam Rumah [ 3 Kamar Tidur, 2 Kamar Mandi ]
Langkah - Langkah Membuatnya:
1. Buka Dev C++ > New Project
2. Project Options > Pilih Compiler > Base Compiler Set: TDM-GCC 4.9.2 32-bit Release
3. Pilih Parameter > Masukkan Linker Berikut:
-lbgi
-lgdi32
-luser32
Didalam Kolom Linker > Klik Ok
4. Silahkan Copy-Paste Script Program Dibawah Ini Ke Project Baru Anda:
6. Sekian Dan Terima Kasih
#include <graphics.h>
#include <iostream>
using namespace std;
main(){
// Desain Dalam Rumah [3 Kamar Tidur, 2 Kamar Mandi]
// Copyright © 2018: Komputer Grafika
// Khairul Fuad 5SIA2
initwindow(1280,700);
int maxx = getmaxx();
int maxy = getmaxy();
int midx = maxx/2;
int midy = maxy/2;
int r_alas = 630;
int r_tinggi = 340;
//kerangka luar
rectangle(midx-r_alas,midy-r_tinggi,midx+r_alas,midy+r_tinggi);
//arsir atas
line(5,15,1265,15);
int ar_atas1, ar_atas2, ar_atas3, ar_atas4, ar_atas5, ar_atas6, ar_atas7, ar_atas8;
for(ar_atas1=15,ar_atas2=20;ar_atas1<=270,ar_atas2<=270;ar_atas1+=5,ar_atas2+=5){
line(ar_atas1,15,ar_atas2,4);
}
for(ar_atas3=281,ar_atas4=286;ar_atas3<=390,ar_atas4<=390;ar_atas3+=5,ar_atas4+=5){
line(ar_atas3,15,ar_atas4,4);
}
for(ar_atas5=401,ar_atas6=406;ar_atas5<=800,ar_atas6<=800;ar_atas5+=5,ar_atas6+=5){
line(ar_atas5,15,ar_atas6,4);
}
for(ar_atas7=811,ar_atas8=816;ar_atas7<=860,ar_atas8<=860;ar_atas7+=5,ar_atas8+=5){
line(ar_atas7,15,ar_atas8,4);
}
//arsir kiri
line(15,5,15,684);
int ar_kiri1, ar_kiri2, ar_kiri3, ar_kiri4, ar_kiri5, ar_kiri6;
for(ar_kiri1=15, ar_kiri2=20;ar_kiri1<=160, ar_kiri2<=160;ar_kiri1+=5, ar_kiri2+=5){
line(15,ar_kiri1,5,ar_kiri2);
}
for(ar_kiri3=171, ar_kiri4=176;ar_kiri3<=370, ar_kiri4<=370;ar_kiri3+=5, ar_kiri4+=5){
line(15,ar_kiri3,5,ar_kiri4);
}
for(ar_kiri5=381, ar_kiri6=386;ar_kiri5<=670, ar_kiri6<=670;ar_kiri5+=5, ar_kiri6+=5){
line(15,ar_kiri5,5,ar_kiri6);
}
//arsir bawah
line(5,670,1265,670);
int ar_bawah1, ar_bawah2, ar_bawah3, ar_bawah4, ar_bawah5, ar_bawah6, ar_bawah7, ar_bawah8;
for(ar_bawah1=20, ar_bawah2=15;ar_bawah1<=265, ar_bawah2<=265;ar_bawah1+=5, ar_bawah2+=5){
line(ar_bawah1,670,ar_bawah2,684);
}
for(ar_bawah3=286, ar_bawah4=281;ar_bawah3<=420, ar_bawah4<=420;ar_bawah3+=5, ar_bawah4+=5){
line(ar_bawah3,670,ar_bawah4,684);
}
for(ar_bawah5=436, ar_bawah6=431;ar_bawah5<=650, ar_bawah6<=650;ar_bawah5+=5, ar_bawah6+=5){
line(ar_bawah5,670,ar_bawah6,684);
}
for(ar_bawah7=666, ar_bawah8=661;ar_bawah7<=950, ar_bawah8<=950;ar_bawah7+=5, ar_bawah8+=5){
line(ar_bawah7,670,ar_bawah8,684);
}
//kerangka dalam 1
rectangle(270,3,280,170);
int ar_krk1_1, ar_krk1_2;
for(ar_krk1_1=15,ar_krk1_2=20;ar_krk1_1<=160,ar_krk1_2<=160;ar_krk1_1+=5,ar_krk1_2+=5){
line(280,ar_krk1_1,270,ar_krk1_2);
}
rectangle(270,160,330,170);
line(280,170,285,160);
int ar_krk1_3, ar_krk1_4;
for(ar_krk1_3=280,ar_krk1_4=285;ar_krk1_3<=330,ar_krk1_4<=330;ar_krk1_3+=5,ar_krk1_4+=5){
line(ar_krk1_3,170,ar_krk1_4,160);
}
//kerangka dalam 2
rectangle(390,3,400,170);
int ar_krk2_1, ar_krk2_2;
for(ar_krk2_1=15,ar_krk2_2=20;ar_krk2_1<=160,ar_krk2_2<=160;ar_krk2_1+=5,ar_krk2_2+=5){
line(400,ar_krk2_1,390,ar_krk2_2);
}
//garis antara kerangka dalam 1 & 2
line(330,160,400,160);
//kerangka dalam 3
rectangle(800,3,810,170);
int ar_krk3_1,ar_krk3_2;
for(ar_krk3_1=15,ar_krk3_2=20;ar_krk3_1<=41,ar_krk3_2<=41;ar_krk3_1+=5,ar_krk3_2+=5){
line(810,ar_krk3_1,800,ar_krk3_2);
}
rectangle(800,41,810,45);
rectangle(800,91,810,95);
line(805,45,805,91);
rectangle(700,160,860,170);
int ar_krk3_3,ar_krk3_4,ar_krk3_5,ar_krk3_6;
for(ar_krk3_3=705,ar_krk3_4=700;ar_krk3_3<=795,ar_krk3_4<=795;ar_krk3_3+=5,ar_krk3_4+=5){
line(ar_krk3_3,160,ar_krk3_4,170);
}
for(ar_krk3_5=816,ar_krk3_6=811;ar_krk3_5<=850,ar_krk3_6<=850;ar_krk3_5+=5,ar_krk3_6+=5){
line(ar_krk3_5,160,ar_krk3_6,170);
}
rectangle(850,160,860,300);
rectangle(850,170,860,174);
rectangle(850,174,860,178);
line(855,178,855,232);
rectangle(850,232,860,236);
rectangle(850,236,860,240);
line(860,160,860,3);
int k3[] = {850,240,850,250,860,250};
drawpoly(3,k3);
rectangle(850,250,860,254);
line(855,254,855,296);
rectangle(850,296,860,300);
//kerangka dalam 4
line(850,240,950,240);
int k4[]={930,240,930,260,950,260};
drawpoly(3,k4);
rectangle(950,240,1265,450);
rectangle(950,250,1255,440);
line(950,420,950,684);
//kerangka dalam 5
rectangle(740,360,950,370);
int ar_krk5_1,ar_krk5_2;
for(ar_krk5_1=750,ar_krk5_2=755;ar_krk5_1<=850,ar_krk5_2<=850;ar_krk5_1+=5,ar_krk5_2+=5){
line(ar_krk5_1,370,ar_krk5_2,360);
}
int ar_krk5_3,ar_krk5_4;
for(ar_krk5_3=861,ar_krk5_4=866;ar_krk5_3<=940,ar_krk5_4<=940;ar_krk5_3+=5,ar_krk5_4+=5){
line(ar_krk5_3,370,ar_krk5_4,360);
}
rectangle(940,360,950,580);
int ar_krk5_5,ar_krk5_6;
for(ar_krk5_5=375,ar_krk5_6=370;ar_krk5_5<=410,ar_krk5_6<=410;ar_krk5_5+=5,ar_krk5_6+=5){
line(940,ar_krk5_5,950,ar_krk5_6);
}
rectangle(940,415,950,419);
line(945,419,945,470);
rectangle(940,470,950,474);
line(945,474,945,525);
rectangle(940,525,950,529);
int ar_krk5_7,ar_krk5_8;
for(ar_krk5_7=534,ar_krk5_8=529;ar_krk5_7<=565,ar_krk5_8<=565;ar_krk5_7+=5,ar_krk5_8+=5){
line(940,ar_krk5_7,950,ar_krk5_8);
}
rectangle(650,570,950,580);
int ar_krk5_9,ar_krk5_10;
for(ar_krk5_9=660,ar_krk5_10=665;ar_krk5_9<=740,ar_krk5_10<=740;ar_krk5_9+=5,ar_krk5_10+=5){
line(ar_krk5_9,580,ar_krk5_10,570);
}
int k5_4[] = {740,570,740,580,750,580,750,570};
drawpoly(4,k5_4);
line(751,580,756,570);
int ar_krk5_11,ar_krk5_12;
for(ar_krk5_11=751,ar_krk5_12=756;ar_krk5_11<=940,ar_krk5_12<=940;ar_krk5_11+=5,ar_krk5_12+=5){
line(ar_krk5_11,580,ar_krk5_12,570);
}
rectangle(650,440,660,683);
int ar_krk5_17,ar_krk5_18;
for(ar_krk5_17=455,ar_krk5_18=450;ar_krk5_17<=565,ar_krk5_18<=565;ar_krk5_17+=5,ar_krk5_18+=5){
line(650,ar_krk5_17,660,ar_krk5_18);
}
int ar_krk5_13,ar_krk5_14;
for(ar_krk5_13=585,ar_krk5_14=580;ar_krk5_13<=595,ar_krk5_14<=595;ar_krk5_13+=5,ar_krk5_14+=5){
line(650,ar_krk5_13,660,ar_krk5_14);
}
rectangle(650,600,660,604);
line(655,604,655,649);
rectangle(650,649,660,653);
line(650,657,660,653);
int ar_krk5_15,ar_krk5_16;
for(ar_krk5_15=657,ar_krk5_16=653;ar_krk5_15<=670,ar_krk5_16<=670;ar_krk5_15+=5,ar_krk5_16+=5){
line(650,ar_krk5_15,660,ar_krk5_16);
}
rectangle(650,440,750,450);
int ar_krk5_19,ar_krk5_20;
for(ar_krk5_19=660,ar_krk5_20=665;ar_krk5_19<=740,ar_krk5_20<=740;ar_krk5_19+=5,ar_krk5_20+=5){
line(ar_krk5_19,450,ar_krk5_20,440);
}
line(860,300,860,370);
int k5_3[] = {740,440,740,450,750,450};
drawpoly(3,k5_3);
//kerangka dalam 6
rectangle(420,440,430,683);
int ar_krk6_1,ar_krk6_2;
for(ar_krk6_1=455,ar_krk6_2=450;ar_krk6_1<=515,ar_krk6_2<=515;ar_krk6_1+=5,ar_krk6_2+=5){
line(420,ar_krk6_1,430,ar_krk6_2);
}
int ar_krk6_3,ar_krk6_4;
for(ar_krk6_3=536,ar_krk6_4=531;ar_krk6_3<=670,ar_krk6_4<=670;ar_krk6_3+=5,ar_krk6_4+=5){
line(420,ar_krk6_3,430,ar_krk6_4);
}
rectangle(270,440,570,450);
int ar_krk6_5,ar_krk6_6;
for(ar_krk6_5=280,ar_krk6_6=285;ar_krk6_5<=420,ar_krk6_6<=420;ar_krk6_5+=5,ar_krk6_6+=5){
line(ar_krk6_5,450,ar_krk6_6,440);
}
int ar_krk6_7,ar_krk6_8;
for(ar_krk6_7=431,ar_krk6_8=436;ar_krk6_7<=575,ar_krk6_8<=575;ar_krk6_7+=5,ar_krk6_8+=5){
line(ar_krk6_7,450,ar_krk6_8,440);
}
rectangle(350,520,430,530);
int ar_krk6_9,ar_krk6_10;
for(ar_krk6_9=350,ar_krk6_10=355;ar_krk6_9<=420,ar_krk6_10<=420;ar_krk6_9+=5,ar_krk6_10+=5){
line(ar_krk6_9,530,ar_krk6_10,520);
}
rectangle(270,520,280,683);
int ar_krk6_11,ar_krk6_12;
for(ar_krk6_11=535,ar_krk6_12=530;ar_krk6_11<=665,ar_krk6_12<=665;ar_krk6_11+=5,ar_krk6_12+=5){
line(270,ar_krk6_11,280,ar_krk6_12);
}
line(270,530,350,530);
int k6_1[] = {270,440,280,440,280,450};
drawpoly(3,k6_1);
//kerangka dalam 7
rectangle(5,370,280,380);
line(270,3,270,380);
rectangle(5,170,80,370);
int k7_1[] = {70,170,70,70,270,70};
drawpoly(3,k7_1);
line(5,160,70,160);
rectangle(15,370,19,380);
line(19,375,71,375);
rectangle(71,370,75,380);
int ar_krk7_1,ar_krk7_2;
for(ar_krk7_1=75,ar_krk7_2=80;ar_krk7_1<=270,ar_krk7_2<=270;ar_krk7_1+=5,ar_krk7_2+=5){
line(ar_krk7_1,380,ar_krk7_2,370);
}
//wastafel
rectangle(19,69,65,155);
rectangle(23,73,61,106);
circle(56,100,3);
int x1;
for(x1=24;x1<61;x1+=3){
line(x1,110,x1,154);
}
//kompor
rectangle(130,20,200,65);
rectangle(131,30,199,64);
int x2;
for(x2=137;x2<170;x2+=8){
line(x2,20,x2,30);
}
circle(150,47,10);
circle(150,47,5);
line(140,37,160,57);
line(160,37,140,57);
circle(180,47,10);
circle(180,47,5);
line(170,37,190,57);
line(190,37,170,57);
//meja dapur
int meja_dapur[] = {170,129,270,129,270,170,170,170};
drawpoly(4,meja_dapur);
arc(183,150,121,239,25);
//meja makan
rectangle(145,220,205,320);
rectangle(147,223,202,317);
rectangle(150,225,200,315);
//kursi makan atas
rectangle(155,175,195,215);
rectangle(156,178,194,214);
//kursi makan bawah
rectangle(155,325,195,365);
rectangle(156,326,194,362);
//kursi makan kiri 1
rectangle(100,225,140,265);
rectangle(103,226,139,264);
//kursi makan kiri 2
rectangle(100,275,140,315);
rectangle(103,276,139,314);
//kursi makan kanan 1
rectangle(210,225,250,265);
rectangle(211,226,247,264);
//kursi makan kanan 2
rectangle(210,275,250,315);
rectangle(211,276,247,314);
//bak air 1
rectangle(280,15,340,80);
circle(283,18,3);
//WC 1
rectangle(345,15,380,30);
rectangle(350,30,375,35);
ellipse(363,54,120,60,15,25);
int wc1[] = {380,20,385,20,385,15};
drawpoly(3,wc1);
//pintu WC 1
int pintu_wc1[] = {390,170,388,170,388,104,386,104,386,160};
drawpoly(5,pintu_wc1);
//tangga
line(400,91,710,91);
line(710,93,800,93);
int tangga1, tangga2;
for(tangga1=478;tangga1<=689;tangga1+=21){
line(tangga1,15,tangga1,91);
}
for(tangga2=689;tangga2>=584;tangga2-=21){
line(tangga2,96,tangga2,160);
}
line(710,15,710,160);
line(584,96,710,96);
line(584,160,710,160);
int arah_panah_tangga[] = {439,91,439,54,740,54,740,128,588,128,598,124,598,128};
drawpoly(7,arah_panah_tangga);
setlinestyle(0,0,2);
circle(439,91,3);
setlinestyle(0,0,0);
//pintu tangga
int pintu_tangga[] = {810,158,738,158,738,157,800,157};
drawpoly(4,pintu_tangga);
//sofa besar ruang tamu
rectangle(668,170,810,180);
rectangle(673,180,805,220);
rectangle(663,180,673,210);
rectangle(805,180,815,210);
line(716,170,716,220);
line(763,170,763,220);
//meja ruang tamu
rectangle(700,235,783,275);
//sofa kecil ruang tamu 1
rectangle(840,228,850,278);
rectangle(803,233,840,273);
rectangle(810,226,840,233);
rectangle(810,273,840,280);
//sofa kecil ruang tamu 2
rectangle(643,233,680,273);
rectangle(633,228,643,278);
rectangle(643,226,673,233);
rectangle(643,273,673,280);
//sofa bulat ruang tamu 1
circle(720,300,18);
//sofa bualt ruang tamu 2
circle(763,300,18);
//pintu teras
int pintu_teras[] = {860,358,794,358,794,356,850,356,850,370};
drawpoly(5,pintu_teras);
//kasur tidur 1
rectangle(830,405,900,547);
int kasur1_1[] = {830,525,790,525,790,570,940,570,940,525,900,525};
drawpoly(6,kasur1_1);
circle(813,547,13);
line(800,547,826,547);
line(813,534,813,560);
circle(917,547,13);
line(904,547,930,547);
line(917,534,917,560);
int kasur1_2[] = {900,520,830,500,900,500,830,480};
drawpoly(4,kasur1_2);
//pintu kamar tidur 1
int pintu_kamar_tidur_1[] = {740,372,805,372,805,374,750,374,750,360};
drawpoly(5,pintu_kamar_tidur_1);
//kasur tidur 2
rectangle(470,506,540,648);
int kasur2_1[] = {470,625,430,625,430,670,580,670,580,625,540,625};
drawpoly(6,kasur2_1);
circle(453,648,13);
line(440,648,466,648);
line(453,635,453,661);
circle(557,648,13);
line(544,648,570,648);
line(557,635,557,661);
int kasur2_2[] = {540,626,470,606,540,606,470,586};
drawpoly(4,kasur2_2);
//pintu kamar tidur 2
int pintu_kamar_tidur_2[] = {648,440,648,523,646,523,646,450,650,450};
drawpoly(5,pintu_kamar_tidur_2);
//WC 2
rectangle(290,655,325,670);
rectangle(295,650,320,655);
ellipse(308,633,300,240,15,25);
int wc2[] = {290,665,285,665,285,670};
drawpoly(3,wc2);
//bak air 2
rectangle(340,608,420,670);
rectangle(345,613,415,665);
//pintu wc 2
int pintu_wc2[] = {282,520,282,595,284,595,284,530,280,530};
drawpoly(5,pintu_wc2);
//keran air kamar mandi 2
rectangle(380,462,420,508);
rectangle(385,467,410,503);
circle(410,490,3);
setlinestyle(0,0,3);
line(406,485,406,485);
setlinestyle(0,0,5);
line(410,480,410,480);
setlinestyle(0,0,0);
//kasur utama
rectangle(55,506,200,648);
int kasur_utama[] = {55,625,15,625,15,670,240,670,240,625,200,625};
drawpoly(6,kasur_utama);
circle(38,648,13);
line(38,635,38,661);
line(25,648,51,648);
circle(217,648,13);
line(217,635,217,661);
line(204,648,230,648);
//bantal kasur utama kiri & kanan
rectangle(60,615,120,643);
rectangle(135,615,195,643);
//selimut kasur utama
int selimut[] = {200,610,80,610,55,506,100,595,80,610};
drawpoly(5,selimut);
//pintu kamar tidur utama
int pintu_kamar_utama[] = {280,382,214,382,214,384,270,384,270,380};
drawpoly(5,pintu_kamar_utama);
//sofa besar ruang keluarga
rectangle(400,190,542,200);
rectangle(405,200,537,240);
rectangle(395,200,405,230);
rectangle(537,200,547,230);
line(447,190,447,240);
line(494,190,494,240);
rectangle(552,200,592,240);
circle(572,220,15);
line(555,220,589,220);
line(572,203,572,237);
line(547,220,552,220);
rectangle(350,200,390,240);
circle(370,220,15);
line(353,220,387,220);
line(370,203,370,237);
line(390,220,395,220);
//meja ruang keluarga
rectangle(416,278,527,348);
//sofa kecil ruang keluarga 1
rectangle(589,253,599,303);
rectangle(552,258,589,298);
rectangle(559,251,589,258);
rectangle(559,298,589,305);
line(577,240,577,252);
//sofa kecil ruang keluarga 2
rectangle(589,323,599,373);
rectangle(552,328,589,368);
rectangle(559,321,589,328);
rectangle(559,368,589,375);
line(577,305,577,321);
int garis_sofa_ruang_tamu[] = {577,375,577,385,366,385,366,240};
drawpoly(4,garis_sofa_ruang_tamu);
//meja tv ruang keluarga
rectangle(413,405,529,440);
//tv ruang keluarga
int tv[] = {460,430,465,440,485,440,490,430};
drawpoly(4,tv);
rectangle(455,410,495,430);
arc(475,507,78,102,100);
int antena_tv[] = {460,385,470,430,490,375};
drawpoly(3,antena_tv);
setlinestyle(DOTTED_LINE,0,0);
//jalur pintu wc 1
arc(386,160,90,180,56);
//jalur pintu tangga
arc(800,157,90,180,62);
//jalur pintu teras
arc(850,356,90,180,55);
//jalur pintu kamar tidur 1
arc(740,372,270,360,68);
//jalur pintu kamar 2
arc(646,450,180,270,75);
//jalur pintu wc 2
arc(284,530,270,360,66);
//jalur pintu kamar utama
arc(270,384,180,270,56);
getch();
closegraph();
return 0;
}
5. Kemudian Save Dan Tekan F116. Sekian Dan Terima Kasih
Related Posts
Subscribe Our Newsletter
Belum ada Komentar untuk "Tutorial Desain Dalam Rumah Dengan Dev C++"
Posting Komentar