Advertisement
extreme404

Grafkom

Nov 11th, 2019
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 31.67 KB | None | 0 0
  1. #include <GL/glut.h>
  2. //mengaktifkan fungsi perhitungan matematika
  3. #include <math.h>
  4. #include <cmath>
  5.  
  6.  
  7. int dstTime = 0; // milliseconds
  8.  
  9. struct Color
  10. {
  11. float r, g, b;
  12. };
  13.  
  14. Color makeColor(float r, float g, float b)
  15. {
  16. Color c = { r, g, b };
  17. return c;
  18. };
  19.  
  20. Color lerp(Color a, Color b, float t)
  21. {
  22. Color c;
  23. c.r = (1 - t) * a.r + t * b.r;
  24. c.g = (1 - t) * a.g + t * b.g;
  25. c.b = (1 - t) * a.b + t * b.b;
  26.  
  27. return c;
  28. }
  29.  
  30.  
  31. static int timeFor = 0;
  32. //deklarasi pembuatan lingkaran
  33. const double PI = 3.142857143;
  34. int i, radius, jumlah_titik, x_tengah, y_tengah;
  35.  
  36. //deklarasi gerakan otomatis
  37. int gerak = 0;
  38. bool atas = true;
  39.  
  40. //rgb(0.07,0.38,0.56)
  41. //0.36, 0.54, 0.66
  42. //rgb(0.00,0.90,1.00)
  43.  
  44.  
  45.  
  46. void tampil()
  47. {
  48.  
  49. const int curTime = glutGet(GLUT_ELAPSED_TIME);
  50.  
  51. // figure out how far along duration we are, between 0.0 and 1.0
  52. const float t = std::cos(float(curTime) * 0.00027) * 0.5 + 0.5;
  53.  
  54. // interpolate between two colors
  55. Color curColor = lerp(makeColor(0.00, 0.90, 1.00), makeColor(0.07, 0.38, 0.56), t);
  56.  
  57. glClearColor(curColor.r, curColor.g, curColor.b, 1);
  58. // glClear(GL_COLOR_BUFFER_BIT);
  59. // glutSwapBuffers();
  60.  
  61.  
  62. //perintah menghapus layar
  63. //glClear(GL_COLOR_BUFFER_BIT);
  64.  
  65. ///////BAYANG////////
  66.  
  67. //bayang1
  68. glColor3f(0.41, 0.41, 0.41);
  69. glBegin(GL_POLYGON);
  70. glVertex2f(-25.6848345783986, 58.2583838680072);
  71. glVertex2f(14.8784403820487, 58.2583838680072);
  72. glVertex2f(14.8784403820487, 3.7977699245881);
  73. glVertex2f(-25.6848345783986, 3.7977699245881);
  74. glEnd();
  75. glFlush();
  76.  
  77. //bayang2
  78. glColor3f(0.41, 0.41, 0.41);
  79. glBegin(GL_POLYGON);
  80. glVertex2f(6.7851171976519, 58.5539496887254);
  81. glVertex2f(6.7851171976519, 65.7677447810346);
  82. glVertex2f(14.7804067582946, 65.7677447810346);
  83. glVertex2f(14.7804067582946, 58.5539496887254);
  84. glEnd();
  85. glFlush();
  86.  
  87. //bayang3
  88. glColor3f(0.41, 0.41, 0.41);
  89. glBegin(GL_POLYGON);
  90. glVertex2f(12.740614110478, 40.0307286092);
  91. glVertex2f(60, 40);
  92. glVertex2f(60, 31);
  93. glVertex2f(12.6349539322358, 31.0072966553989);
  94. glEnd();
  95. glFlush();
  96.  
  97. //bayang4
  98. glColor3f(0.41, 0.41, 0.41);
  99. glBegin(GL_POLYGON);
  100. glVertex2f(20, 40);
  101. glVertex2f(20.0603107455486, 58.2651258296417);
  102. glVertex2f(60.0673711502669, 58.284620863342);
  103. glVertex2f(60, 40);
  104. glEnd();
  105. glFlush();
  106.  
  107. //bayang5
  108. glColor3f(0.41, 0.41, 0.41);
  109. glBegin(GL_POLYGON);
  110. glVertex2f(52.6836532342533, 40.1388417253855);
  111. glVertex2f(52.6895681344281, 65.25810260369);
  112. glVertex2f(60.0181713898393, 65.261071477137);
  113. glVertex2f(60, 40);
  114. glEnd();
  115. glFlush();
  116. /*glVertex2f(52.6895681344281, 65.25810260369);
  117. glVertex2f(60.0181713898393, 65.261071477137);
  118. glVertex2f(60, 31);
  119. glVertex2f(12.6349539322358, 31.0072966553989);*/
  120. glEnd();
  121. glFlush();
  122.  
  123. /////GEDUNG BESAR//////////
  124.  
  125. //gedung 1
  126. glColor3f(0.67, 0.67, 0.67);
  127. glBegin(GL_POLYGON);
  128. glVertex2f(-7.8513535566571, 3.7977699245881);
  129. glVertex2f(-7.851353556657, 61.9569410492472);
  130. glVertex2f(16.9543275729469, 61.9569410492472);
  131. glVertex2f(16.9543275729469, 3.7977699245881);
  132. glEnd();
  133. glFlush();
  134.  
  135. //pintu
  136. glColor3f(0.0, 0.0, 0.0);
  137. glBegin(GL_POLYGON);
  138. glVertex2f(0.9865533846835, 3.9106660657593);
  139. glVertex2f(0.9865533846835, 9.2626553880784);
  140. glVertex2f(5.6385427070026, 9.2626553880784);
  141. glVertex2f(5.6385427070026, 3.9106660657593);
  142. glEnd();
  143. glFlush();
  144.  
  145.  
  146. //jendela kecil 1
  147. glColor3f(1.00, 1.00, 0.20);
  148. glBegin(GL_POLYGON);
  149. glVertex2f(-4.7919173153694, 53.9373474344403);
  150. glVertex2f(-4.7919173153694, 56.3893367567594);
  151. glVertex2f(-2.3399279930503, 56.3893367567594);
  152. glVertex2f(-2.3399279930503, 53.9373474344403);
  153. glEnd();
  154. glFlush();
  155.  
  156. //jendela kecil 2
  157. glColor3f(1.00, 1.00, 0.20);
  158. glBegin(GL_POLYGON);
  159. glVertex2f(-4.8230838136912, 48.1501389577261);
  160. glVertex2f(-4.8230838136912, 50.6021282800452);
  161. glVertex2f(-2.3710944913721, 50.6021282800452);
  162. glVertex2f(-2.3710944913721, 48.1501389577261);
  163. glEnd();
  164. glFlush();
  165.  
  166. //jendela kecil 3
  167. glColor3f(1.00, 1.00, 0.20);
  168. glBegin(GL_POLYGON);
  169. glVertex2f(-4.7851029515167, 42.6429139424234);
  170. glVertex2f(-4.7851029515167, 45.0949032647425);
  171. glVertex2f(-2.3331136291976, 45.0949032647425);
  172. glVertex2f(-2.3331136291976, 42.6429139424234);
  173. glEnd();
  174. glFlush();
  175.  
  176. //jendela kecil 4
  177. glColor3f(1.00, 1.00, 0.20);
  178. glBegin(GL_POLYGON);
  179. glVertex2f(-4.7604224429328, 36.7704172972917);
  180. glVertex2f(-4.7604224429328, 39.2224066196108);
  181. glVertex2f(-2.3084331206137, 39.2224066196108);
  182. glVertex2f(-2.3084331206137, 36.7704172972917);
  183. glEnd();
  184. glFlush();
  185.  
  186. //jendela kecil 5
  187. glColor3f(1.00, 1.00, 0.20);
  188. glBegin(GL_POLYGON);
  189. glVertex2f(-4.7183078444682, 30.9164881107123);
  190. glVertex2f(-4.7183078444682, 33.3684774330314);
  191. glVertex2f(-2.2663185221491, 33.3684774330314);
  192. glVertex2f(-2.2663185221491, 30.9164881107123);
  193. glEnd();
  194. glFlush();
  195.  
  196. //jendela kecil 6
  197. glColor3f(1.00, 1.00, 0.20);
  198. glBegin(GL_POLYGON);
  199. glVertex2f(-4.8025370413974, 25.3994757118498);
  200. glVertex2f(-4.8025370413974, 27.8514650341688);
  201. glVertex2f(-2.3505477190783, 27.8514650341688);
  202. glVertex2f(-2.3505477190783, 25.3994757118498);
  203. glEnd();
  204. glFlush();
  205.  
  206. //jendela kecil 7
  207. glColor3f(1.00, 1.00, 0.20);
  208. glBegin(GL_POLYGON);
  209. glVertex2f(-4.7619238465033, 19.5346789745466);
  210. glVertex2f(-4.7619238465033, 21.9866682968656);
  211. glVertex2f(-2.3099345241842, 21.9866682968656);
  212. glVertex2f(-2.3099345241842, 19.5346789745466);
  213. glEnd();
  214. glFlush();
  215.  
  216. //jendela kecil 8
  217. glColor3f(1.00, 1.00, 0.20);
  218. glBegin(GL_POLYGON);
  219. glVertex2f(-4.7830514313818, 13.726676718908);
  220. glVertex2f(-4.7830514313818, 16.0259767213108);
  221. glVertex2f(-2.3347476384461, 16.0259767213108);
  222. glVertex2f(-2.3347476384461, 13.726676718908);
  223. glEnd();
  224. glFlush();
  225.  
  226. //jendela kecil 9
  227. glColor3f(1.00, 1.00, 0.20);
  228. glBegin(GL_POLYGON);
  229. glVertex2f(11.0561275241909, 53.975038634141);
  230. glVertex2f(11.0561275241909, 56.4270279564601);
  231. glVertex2f(13.40811684651, 56.4270279564601);
  232. glVertex2f(13.40811684651, 53.975038634141);
  233. glEnd();
  234. glFlush();
  235.  
  236. //jendela kecil 10
  237. glColor3f(1.00, 1.00, 0.20);
  238. glBegin(GL_POLYGON);
  239. glVertex2f(-4.8230838136912 + 15.8480448396, 48.1501389577261 + 0.0376911997);
  240. glVertex2f(-4.8230838136912+ 15.8480448396, 50.6021282800452 + 0.0376911997);
  241. glVertex2f(-2.3710944913721+ 15.8480448396, 50.6021282800452 + 0.0376911997);
  242. glVertex2f(-2.3710944913721+ 15.8480448396, 48.1501389577261 + 0.0376911997);
  243. glEnd();
  244. glFlush();
  245.  
  246. //jendela kecil 11
  247. glColor3f(1.00, 1.00, 0.20);
  248. glBegin(GL_POLYGON);
  249. glVertex2f(-4.7851029515167 + 15.8480448396, 42.6429139424234 + 0.0376911997);
  250. glVertex2f(-4.7851029515167 + 15.8480448396, 45.0949032647425 + 0.0376911997);
  251. glVertex2f(-2.3331136291976 + 15.8480448396, 45.0949032647425 + 0.0376911997);
  252. glVertex2f(-2.3331136291976 + 15.8480448396, 42.6429139424234 + 0.0376911997);
  253. glEnd();
  254. glFlush();
  255.  
  256. //jendela kecil 12
  257. glColor3f(1.00, 1.00, 0.20);
  258. glBegin(GL_POLYGON);
  259. glVertex2f(-4.7604224429328 + 15.8480448396, 36.7704172972917 + 0.0376911997);
  260. glVertex2f(-4.7604224429328 + 15.8480448396, 39.2224066196108 + 0.0376911997);
  261. glVertex2f(-2.3084331206137 + 15.8480448396, 39.2224066196108 + 0.0376911997);
  262. glVertex2f(-2.3084331206137 + 15.8480448396, 36.7704172972917 + 0.0376911997);
  263. glEnd();
  264. glFlush();
  265.  
  266. //jendela kecil 13
  267. glColor3f(1.00, 1.00, 0.20);
  268. glBegin(GL_POLYGON);
  269. glVertex2f(-4.7183078444682 + 15.8480448396, 30.9164881107123 + 0.0376911997);
  270. glVertex2f(-4.7183078444682 + 15.8480448396, 33.3684774330314 + 0.0376911997);
  271. glVertex2f(-2.2663185221491 + 15.8480448396, 33.3684774330314 + 0.0376911997);
  272. glVertex2f(-2.2663185221491 + 15.8480448396, 30.9164881107123 + 0.0376911997);
  273. glEnd();
  274. glFlush();
  275.  
  276. //jendela kecil 14
  277. glColor3f(1.00, 1.00, 0.20);
  278. glBegin(GL_POLYGON);
  279. glVertex2f(-4.8025370413974 + 15.8480448396, 25.3994757118498 + 0.0376911997);
  280. glVertex2f(-4.8025370413974 + 15.8480448396, 27.8514650341688 + 0.0376911997);
  281. glVertex2f(-2.3505477190783 + 15.8480448396, 27.8514650341688 + 0.0376911997);
  282. glVertex2f(-2.3505477190783 + 15.8480448396, 25.3994757118498 + 0.0376911997);
  283. glEnd();
  284. glFlush();
  285.  
  286. //jendela kecil 15
  287. glColor3f(1.00, 1.00, 0.20);
  288. glBegin(GL_POLYGON);
  289. glVertex2f(-4.7619238465033 + 15.8480448396, 19.5346789745466 + 0.0376911997);
  290. glVertex2f(-4.7619238465033 + 15.8480448396, 21.9866682968656 + 0.0376911997);
  291. glVertex2f(-2.3099345241842 + 15.8480448396, 21.9866682968656 + 0.0376911997);
  292. glVertex2f(-2.3099345241842 + 15.8480448396, 19.5346789745466 + 0.0376911997);
  293. glEnd();
  294. glFlush();
  295.  
  296. //jendela kecil 16
  297. glColor3f(1.00, 1.00, 0.20);
  298. glBegin(GL_POLYGON);
  299. glVertex2f(-4.7830514313818 + 15.8480448396, 13.726676718908 + 0.0376911997);
  300. glVertex2f(-4.7830514313818 + 15.8480448396, 16.0259767213108 + 0.0376911997);
  301. glVertex2f(-2.3347476384461 + 15.8480448396, 16.0259767213108 + 0.0376911997);
  302. glVertex2f(-2.3347476384461 + 15.8480448396, 13.726676718908 + 0.0376911997);
  303. glEnd();
  304. glFlush();
  305.  
  306. //jendela besar 1
  307. glColor3f(1.00, 1.00, 0.20);
  308. glBegin(GL_POLYGON);
  309. glVertex2f(2.0369897641786, 53.932171709106);
  310. glVertex2f(2.0369897641786, 56.4841610314251);
  311. glVertex2f(6.9889790864977, 56.4841610314251);
  312. glVertex2f(6.9889790864977, 53.932171709106);
  313. glEnd();
  314. glFlush();
  315.  
  316. //jendela besar 2
  317. glColor3f(1.00, 1.00, 0.20);
  318. glBegin(GL_POLYGON);
  319. glVertex2f(2.0419653291983, 48.1227787236287);
  320. glVertex2f(2.0419653291983, 50.6747680459478);
  321. glVertex2f(6.9939546515174, 50.6747680459478);
  322. glVertex2f(6.9939546515174, 48.1227787236287);
  323. glEnd();
  324. glFlush();
  325.  
  326. //jendela besar 3
  327. glColor3f(1.00, 1.00, 0.20);
  328. glBegin(GL_POLYGON);
  329. glVertex2f(2.0419653291983, 48.1227787236287 - 5.80939299);
  330. glVertex2f(2.0419653291983, 50.6747680459478 - 5.80939299);
  331. glVertex2f(6.9939546515174, 50.6747680459478 - 5.80939299);
  332. glVertex2f(6.9939546515174, 48.1227787236287 - 5.80939299);
  333. glEnd();
  334. glFlush();
  335.  
  336. //jendela besar 4
  337. glColor3f(1.00, 1.00, 0.20);
  338. glBegin(GL_POLYGON);
  339. glVertex2f(2.0419653291983, 48.1227787236287 - 5.80939299 - 5.80939299);
  340. glVertex2f(2.0419653291983, 50.6747680459478 - 5.80939299 - 5.80939299);
  341. glVertex2f(6.9939546515174, 50.6747680459478 - 5.80939299 - 5.80939299);
  342. glVertex2f(6.9939546515174, 48.1227787236287 - 5.80939299 - 5.80939299);
  343. glEnd();
  344. glFlush();
  345.  
  346. //jendela besar 5
  347. glColor3f(1.00, 1.00, 0.20);
  348. glBegin(GL_POLYGON);
  349. glVertex2f(2.0419653291983, 48.1227787236287 - 5.80939299 - 5.80939299 - 5.80939299);
  350. glVertex2f(2.0419653291983, 50.6747680459478 - 5.80939299 - 5.80939299 - 5.80939299);
  351. glVertex2f(6.9939546515174, 50.6747680459478 - 5.80939299 - 5.80939299 - 5.80939299);
  352. glVertex2f(6.9939546515174, 48.1227787236287 - 5.80939299 - 5.80939299 - 5.80939299);
  353. glEnd();
  354. glFlush();
  355.  
  356. //jendela besar 6
  357. glColor3f(1.00, 1.00, 0.20);
  358. glBegin(GL_POLYGON);
  359. glVertex2f(2.0419653291983, 48.1227787236287 - 5.80939299 - 5.80939299 - 5.80939299 - 5.80939299);
  360. glVertex2f(2.0419653291983, 50.6747680459478 - 5.80939299 - 5.80939299 - 5.80939299 - 5.80939299);
  361. glVertex2f(6.9939546515174, 50.6747680459478 - 5.80939299 - 5.80939299 - 5.80939299 - 5.80939299);
  362. glVertex2f(6.9939546515174, 48.1227787236287 - 5.80939299 - 5.80939299 - 5.80939299 - 5.80939299);
  363. glEnd();
  364. glFlush();
  365.  
  366. //jendela besar 7
  367. glColor3f(1.00, 1.00, 0.20);
  368. glBegin(GL_POLYGON);
  369. glVertex2f(2.0419653291983, 48.1227787236287 - 5.80939299 - 5.80939299 - 5.80939299 - 5.80939299 - 5.80939299);
  370. glVertex2f(2.0419653291983, 50.6747680459478 - 5.80939299 - 5.80939299 - 5.80939299 - 5.80939299 - 5.80939299);
  371. glVertex2f(6.9939546515174, 50.6747680459478 - 5.80939299 - 5.80939299 - 5.80939299 - 5.80939299 - 5.80939299);
  372. glVertex2f(6.9939546515174, 48.1227787236287 - 5.80939299 - 5.80939299 - 5.80939299 - 5.80939299 - 5.80939299);
  373. glEnd();
  374. glFlush();
  375.  
  376. //jendela besar 8
  377. glColor3f(1.00, 1.00, 0.20);
  378. glBegin(GL_POLYGON);
  379. glVertex2f(2.0419653291983, 48.1227787236287 - 5.80939299 - 5.80939299 - 5.80939299 - 5.80939299 - 5.80939299 - 5.80939299);
  380. glVertex2f(2.0419653291983, 50.6747680459478 - 5.80939299 - 5.80939299 - 5.80939299 - 5.80939299 - 5.80939299 - 5.80939299);
  381. glVertex2f(6.9939546515174, 50.6747680459478 - 5.80939299 - 5.80939299 - 5.80939299 - 5.80939299 - 5.80939299 - 5.80939299);
  382. glVertex2f(6.9939546515174, 48.1227787236287 - 5.80939299 - 5.80939299 - 5.80939299 - 5.80939299 - 5.80939299 - 5.80939299);
  383. glEnd();
  384. glFlush();
  385.  
  386. //GEDUNG BESAR///
  387. glColor3f(0.67, 0.67, 0.67);
  388. glBegin(GL_POLYGON);
  389. glVertex2f(37.7907464870846, 3.2583591918809);
  390. glVertex2f(37.7907464870846, 61.6130021670603);
  391. glVertex2f(60.5964276166886, 61.6130021670603);
  392. glVertex2f(60.5964276166886, 3.2583591918809);
  393. glEnd();
  394. glFlush();
  395.  
  396. //jendela 1
  397. glColor3f(1.00, 1.00, 0.20);
  398. glBegin(GL_POLYGON);
  399. glVertex2f(41.269907929601, 13.7567911330596);
  400. glVertex2f(41.269907929601, 16.2087804553787);
  401. glVertex2f(43.7218972519201, 16.2087804553787);
  402. glVertex2f(43.7218972519201, 13.7567911330596);
  403. glEnd();
  404. glFlush();
  405.  
  406. //jendela 2
  407. glColor3f(1.00, 1.00, 0.20);
  408. glBegin(GL_POLYGON);
  409. glVertex2f(41.2614345370283, 19.6572880802316);
  410. glVertex2f(41.2614345370283, 22.1092774025507);
  411. glVertex2f(43.7134238593474, 22.1092774025507);
  412. glVertex2f(43.7134238593474, 19.6572880802316);
  413. glEnd();
  414. glFlush();
  415.  
  416. //jendela 3
  417. glColor3f(1.00, 1.00, 0.20);
  418. glBegin(GL_POLYGON);
  419. glVertex2f(41.2614345370283, 19.6572880802316 + 5.90049695);
  420. glVertex2f(41.2614345370283, 22.1092774025507 + 5.90049695);
  421. glVertex2f(43.7134238593474, 22.1092774025507 + 5.90049695);
  422. glVertex2f(43.7134238593474, 19.6572880802316 + 5.90049695);
  423. glEnd();
  424. glFlush();
  425.  
  426. //jendela 4
  427. glColor3f(1.00, 1.00, 0.20);
  428. glBegin(GL_POLYGON);
  429. glVertex2f(41.2614345370283, 19.6572880802316 + 5.90049695 + 5.90049695);
  430. glVertex2f(41.2614345370283, 22.1092774025507 + 5.90049695 + 5.90049695);
  431. glVertex2f(43.7134238593474, 22.1092774025507 + 5.90049695 + 5.90049695);
  432. glVertex2f(43.7134238593474, 19.6572880802316 + 5.90049695 + 5.90049695);
  433. glEnd();
  434. glFlush();
  435.  
  436. //jendela 5
  437. glColor3f(1.00, 1.00, 0.20);
  438. glBegin(GL_POLYGON);
  439. glVertex2f(41.2614345370283, 19.6572880802316 + 5.90049695 + 5.90049695 + 5.90049695);
  440. glVertex2f(41.2614345370283, 22.1092774025507 + 5.90049695 + 5.90049695 + 5.90049695);
  441. glVertex2f(43.7134238593474, 22.1092774025507 + 5.90049695 + 5.90049695 + 5.90049695);
  442. glVertex2f(43.7134238593474, 19.6572880802316 + 5.90049695 + 5.90049695 + 5.90049695);
  443. glEnd();
  444. glFlush();
  445.  
  446. //jendela 6
  447. glColor3f(1.00, 1.00, 0.20);
  448. glBegin(GL_POLYGON);
  449. glVertex2f(41.2614345370283, 19.6572880802316 + 5.90049695 + 5.90049695 + 5.90049695 + 5.90049695);
  450. glVertex2f(41.2614345370283, 22.1092774025507 + 5.90049695 + 5.90049695 + 5.90049695 + 5.90049695);
  451. glVertex2f(43.7134238593474, 22.1092774025507 + 5.90049695 + 5.90049695 + 5.90049695 + 5.90049695);
  452. glVertex2f(43.7134238593474, 19.6572880802316 + 5.90049695 + 5.90049695 + 5.90049695 + 5.90049695);
  453. glEnd();
  454. glFlush();
  455.  
  456. //jendela 7
  457. glColor3f(1.00, 1.00, 0.20);
  458. glBegin(GL_POLYGON);
  459. glVertex2f(41.2614345370283, 19.6572880802316 + 5.90049695 + 5.90049695 + 5.90049695 + 5.90049695 + 5.90049695);
  460. glVertex2f(41.2614345370283, 22.1092774025507 + 5.90049695 + 5.90049695 + 5.90049695 + 5.90049695 + 5.90049695);
  461. glVertex2f(43.7134238593474, 22.1092774025507 + 5.90049695 + 5.90049695 + 5.90049695 + 5.90049695 + 5.90049695);
  462. glVertex2f(43.7134238593474, 19.6572880802316 + 5.90049695 + 5.90049695 + 5.90049695 + 5.90049695 + 5.90049695);
  463. glEnd();
  464. glFlush();
  465.  
  466. //jendela 8
  467. glColor3f(1.00, 1.00, 0.20);
  468. glBegin(GL_POLYGON);
  469. glVertex2f(41.2614345370283, 19.6572880802316 + 5.90049695 + 5.90049695 + 5.90049695 + 5.90049695 + 5.90049695 + 5.90049695);
  470. glVertex2f(41.2614345370283, 22.1092774025507 + 5.90049695 + 5.90049695 + 5.90049695 + 5.90049695 + 5.90049695 + 5.90049695);
  471. glVertex2f(43.7134238593474, 22.1092774025507 + 5.90049695 + 5.90049695 + 5.90049695 + 5.90049695 + 5.90049695 + 5.90049695);
  472. glVertex2f(43.7134238593474, 19.6572880802316 + 5.90049695 + 5.90049695 + 5.90049695 + 5.90049695 + 5.90049695 + 5.90049695);
  473. glEnd();
  474. glFlush();
  475.  
  476. //jendela9
  477. glColor3f(1.00, 1.00, 0.20);
  478. glBegin(GL_POLYGON);
  479. glVertex2f(54.7960899456286, 13.8045959867067);
  480. glVertex2f(54.7960899456286, 16.2565853090258);
  481. glVertex2f(57.2480792679477, 16.2565853090258);
  482. glVertex2f(57.2480792679477, 13.8045959867067);
  483. glEnd();
  484. glFlush();
  485.  
  486. //jendela10
  487. glColor3f(1.00, 1.00, 0.20);
  488. glBegin(GL_POLYGON);
  489. glVertex2f(54.7960899456286, 13.8045959867067 + 5.90049695);
  490. glVertex2f(54.7960899456286, 16.2565853090258 + 5.90049695);
  491. glVertex2f(57.2480792679477, 16.2565853090258 + 5.90049695);
  492. glVertex2f(57.2480792679477, 13.8045959867067 + 5.90049695);
  493. glEnd();
  494. glFlush();
  495.  
  496. //jendela11
  497. glColor3f(1.00, 1.00, 0.20);
  498. glBegin(GL_POLYGON);
  499. glVertex2f(54.7960899456286, 13.8045959867067 + 5.90049695 + 5.90049695);
  500. glVertex2f(54.7960899456286, 16.2565853090258 + 5.90049695 + 5.90049695);
  501. glVertex2f(57.2480792679477, 16.2565853090258 + 5.90049695 + 5.90049695);
  502. glVertex2f(57.2480792679477, 13.8045959867067 + 5.90049695 + 5.90049695);
  503. glEnd();
  504. glFlush();
  505.  
  506. //jendela12
  507. glColor3f(1.00, 1.00, 0.20);
  508. glBegin(GL_POLYGON);
  509. glVertex2f(54.7960899456286, 13.8045959867067 + 5.90049695 + 5.90049695 + 5.90049695);
  510. glVertex2f(54.7960899456286, 16.2565853090258 + 5.90049695 + 5.90049695 + 5.90049695);
  511. glVertex2f(57.2480792679477, 16.2565853090258 + 5.90049695 + 5.90049695 + 5.90049695);
  512. glVertex2f(57.2480792679477, 13.8045959867067 + 5.90049695 + 5.90049695 + 5.90049695);
  513. glEnd();
  514. glFlush();
  515.  
  516. //jendela13
  517. glColor3f(1.00, 1.00, 0.20);
  518. glBegin(GL_POLYGON);
  519. glVertex2f(54.7960899456286, 13.8045959867067 + 5.90049695 + 5.90049695 + 5.90049695 + 5.90049695);
  520. glVertex2f(54.7960899456286, 16.2565853090258 + 5.90049695 + 5.90049695 + 5.90049695 + 5.90049695);
  521. glVertex2f(57.2480792679477, 16.2565853090258 + 5.90049695 + 5.90049695 + 5.90049695 + 5.90049695);
  522. glVertex2f(57.2480792679477, 13.8045959867067 + 5.90049695 + 5.90049695 + 5.90049695 + 5.90049695);
  523. glEnd();
  524. glFlush();
  525.  
  526. //jendela14
  527. glColor3f(1.00, 1.00, 0.20);
  528. glBegin(GL_POLYGON);
  529. glVertex2f(54.7960899456286, 13.8045959867067 + 5.90049695 + 5.90049695 + 5.90049695 + 5.90049695 + 5.90049695);
  530. glVertex2f(54.7960899456286, 16.2565853090258 + 5.90049695 + 5.90049695 + 5.90049695 + 5.90049695 + 5.90049695);
  531. glVertex2f(57.2480792679477, 16.2565853090258 + 5.90049695 + 5.90049695 + 5.90049695 + 5.90049695 + 5.90049695);
  532. glVertex2f(57.2480792679477, 13.8045959867067 + 5.90049695 + 5.90049695 + 5.90049695 + 5.90049695 + 5.90049695);
  533. glEnd();
  534. glFlush();
  535.  
  536. //jendela15
  537. glColor3f(1.00, 1.00, 0.20);
  538. glBegin(GL_POLYGON);
  539. glVertex2f(54.7960899456286, 13.8045959867067 + 5.90049695 + 5.90049695 + 5.90049695 + 5.90049695 + 5.90049695 + 5.90049695);
  540. glVertex2f(54.7960899456286, 16.2565853090258 + 5.90049695 + 5.90049695 + 5.90049695 + 5.90049695 + 5.90049695 + 5.90049695);
  541. glVertex2f(57.2480792679477, 16.2565853090258 + 5.90049695 + 5.90049695 + 5.90049695 + 5.90049695 + 5.90049695 + 5.90049695);
  542. glVertex2f(57.2480792679477, 13.8045959867067 + 5.90049695 + 5.90049695 + 5.90049695 + 5.90049695 + 5.90049695 + 5.90049695);
  543. glEnd();
  544. glFlush();
  545.  
  546. //jendela16
  547. glColor3f(1.00, 1.00, 0.20);
  548. glBegin(GL_POLYGON);
  549. glVertex2f(54.7960899456286, 13.8045959867067 + 5.90049695 + 5.90049695 + 5.90049695 + 5.90049695 + 5.90049695 + 5.90049695 + 5.90049695);
  550. glVertex2f(54.7960899456286, 16.2565853090258 + 5.90049695 + 5.90049695 + 5.90049695 + 5.90049695 + 5.90049695 + 5.90049695 + 5.90049695);
  551. glVertex2f(57.2480792679477, 16.2565853090258 + 5.90049695 + 5.90049695 + 5.90049695 + 5.90049695 + 5.90049695 + 5.90049695 + 5.90049695);
  552. glVertex2f(57.2480792679477, 13.8045959867067 + 5.90049695 + 5.90049695 + 5.90049695 + 5.90049695 + 5.90049695 + 5.90049695 + 5.90049695);
  553. glEnd();
  554. glFlush();
  555.  
  556. //jendela besar 1
  557. glColor3f(1.00, 1.00, 0.20);
  558. glBegin(GL_POLYGON);
  559. glVertex2f(47.0968939348456, 55.0646605762769);
  560. glVertex2f(47.0968939348456, 57.516649898596);
  561. glVertex2f(51.7488832571647, 57.516649898596);
  562. glVertex2f(51.7488832571647, 55.0646605762769);
  563. glEnd();
  564. glFlush();
  565.  
  566. //jendela besar 2
  567. glColor3f(1.00, 1.00, 0.20);
  568. glBegin(GL_POLYGON);
  569. glVertex2f(47.0968939348456, 55.0646605762769 - 5.90049695);
  570. glVertex2f(47.0968939348456, 57.516649898596 - 5.90049695);
  571. glVertex2f(51.7488832571647, 57.516649898596 - 5.90049695);
  572. glVertex2f(51.7488832571647, 55.0646605762769 - 5.90049695);
  573. glEnd();
  574. glFlush();
  575.  
  576. //jendela besar 3
  577. glColor3f(1.00, 1.00, 0.20);
  578. glBegin(GL_POLYGON);
  579. glVertex2f(47.0968939348456, 55.0646605762769 - 5.90049695 - 5.90049695);
  580. glVertex2f(47.0968939348456, 57.516649898596 - 5.90049695 - 5.90049695);
  581. glVertex2f(51.7488832571647, 57.516649898596 - 5.90049695 - 5.90049695);
  582. glVertex2f(51.7488832571647, 55.0646605762769 - 5.90049695 - 5.90049695);
  583. glEnd();
  584. glFlush();
  585.  
  586. //jendela besar 4
  587. glColor3f(1.00, 1.00, 0.20);
  588. glBegin(GL_POLYGON);
  589. glVertex2f(47.0968939348456, 55.0646605762769 - 5.90049695 - 5.90049695 - 5.90049695);
  590. glVertex2f(47.0968939348456, 57.516649898596 - 5.90049695 - 5.90049695 - 5.90049695);
  591. glVertex2f(51.7488832571647, 57.516649898596 - 5.90049695 - 5.90049695 - 5.90049695);
  592. glVertex2f(51.7488832571647, 55.0646605762769 - 5.90049695 - 5.90049695 - 5.90049695);
  593. glEnd();
  594. glFlush();
  595.  
  596. //jendela besar 5
  597. glColor3f(1.00, 1.00, 0.20);
  598. glBegin(GL_POLYGON);
  599. glVertex2f(47.0968939348456, 55.0646605762769 - 5.90049695 - 5.90049695 - 5.90049695 - 5.90049695);
  600. glVertex2f(47.0968939348456, 57.516649898596 - 5.90049695 - 5.90049695 - 5.90049695 - 5.90049695);
  601. glVertex2f(51.7488832571647, 57.516649898596 - 5.90049695 - 5.90049695 - 5.90049695 - 5.90049695);
  602. glVertex2f(51.7488832571647, 55.0646605762769 - 5.90049695 - 5.90049695 - 5.90049695 - 5.90049695);
  603. glEnd();
  604. glFlush();
  605.  
  606. //jendela besar 6
  607. glColor3f(1.00, 1.00, 0.20);
  608. glBegin(GL_POLYGON);
  609. glVertex2f(47.0968939348456, 55.0646605762769 - 5.90049695 - 5.90049695 - 5.90049695 - 5.90049695 - 5.90049695);
  610. glVertex2f(47.0968939348456, 57.516649898596 - 5.90049695 - 5.90049695 - 5.90049695 - 5.90049695 - 5.90049695);
  611. glVertex2f(51.7488832571647, 57.516649898596 - 5.90049695 - 5.90049695 - 5.90049695 - 5.90049695 - 5.90049695);
  612. glVertex2f(51.7488832571647, 55.0646605762769 - 5.90049695 - 5.90049695 - 5.90049695 - 5.90049695 - 5.90049695);
  613. glEnd();
  614. glFlush();
  615.  
  616. //jendela besar 7
  617. glColor3f(1.00, 1.00, 0.20);
  618. glBegin(GL_POLYGON);
  619. glVertex2f(47.0968939348456, 55.0646605762769 - 5.90049695 - 5.90049695 - 5.90049695 - 5.90049695 - 5.90049695 - 5.90049695);
  620. glVertex2f(47.0968939348456, 57.516649898596 - 5.90049695 - 5.90049695 - 5.90049695 - 5.90049695 - 5.90049695 - 5.90049695);
  621. glVertex2f(51.7488832571647, 57.516649898596 - 5.90049695 - 5.90049695 - 5.90049695 - 5.90049695 - 5.90049695 - 5.90049695);
  622. glVertex2f(51.7488832571647, 55.0646605762769 - 5.90049695 - 5.90049695 - 5.90049695 - 5.90049695 - 5.90049695 - 5.90049695);
  623. glEnd();
  624. glFlush();
  625.  
  626. //jendela besar 8
  627. glColor3f(1.00, 1.00, 0.20);
  628. glBegin(GL_POLYGON);
  629. glVertex2f(47.0968939348456, 55.0646605762769 - 5.90049695 - 5.90049695 - 5.90049695 - 5.90049695 - 5.90049695 - 5.90049695 - 5.90049695);
  630. glVertex2f(47.0968939348456, 57.516649898596 - 5.90049695 - 5.90049695 - 5.90049695 - 5.90049695 - 5.90049695 - 5.90049695 - 5.90049695);
  631. glVertex2f(51.7488832571647, 57.516649898596 - 5.90049695 - 5.90049695 - 5.90049695 - 5.90049695 - 5.90049695 - 5.90049695 - 5.90049695);
  632. glVertex2f(51.7488832571647, 55.0646605762769 - 5.90049695 - 5.90049695 - 5.90049695 - 5.90049695 - 5.90049695 - 5.90049695 - 5.90049695);
  633. glEnd();
  634. glFlush();
  635.  
  636. //pintu
  637. glColor3f(0.00, 0.00, 0.00);
  638. glBegin(GL_POLYGON);
  639. glVertex2f(46.9280382963844, 3.9841111539729);
  640. glVertex2f(46.9280382963844, 9.336100476292);
  641. glVertex2f(51.5800276187035, 9.336100476292);
  642. glVertex2f(51.5800276187035, 3.9841111539729);
  643. glEnd();
  644. glFlush();
  645.  
  646.  
  647.  
  648.  
  649.  
  650. /////// GEDUNG KECIL//////
  651.  
  652. //gedung kecil 1
  653. glColor3f(0.70, 0.75, 0.71);
  654. glBegin(GL_POLYGON);
  655. glVertex2f(15.2, 4);
  656. glVertex2f(15.2, 32);
  657. glVertex2f(37.8, 32);
  658. glVertex2f(37.8, 4);
  659. glEnd();
  660. glFlush();
  661.  
  662. //jendela 1
  663. glColor3f(0.0, 0.0, 0.0);
  664. glBegin(GL_POLYGON);
  665. glVertex2f(18.1533263322379, 25.6619394489688);
  666. glVertex2f(18.1465447981508, 28.0111331988837);
  667. glVertex2f(20.7160831503269, 28.0111331988837);
  668. glVertex2f(20.7160831503269, 25.6619394489688);
  669. glEnd();
  670. glFlush();
  671.  
  672. //jendela 2
  673. glColor3f(0.0, 0.0, 0.0);
  674. glBegin(GL_POLYGON);
  675. glVertex2f(18.2730245855641, 19.6083196536063);
  676. glVertex2f(20.7250139078832, 19.6083196536063);
  677. glVertex2f(20.7250139078832, 22.0603089759254);
  678. glVertex2f(18.2730245855641, 22.0603089759254);
  679. glEnd();
  680. glFlush();
  681.  
  682. //jendela 3
  683. glColor3f(1.00, 1.00, 0.20);
  684. glBegin(GL_POLYGON);
  685. glVertex2f(18.2723039594753, 13.7482168358247);
  686. glVertex2f(18.2723039594753, 16.2002061581438);
  687. glVertex2f(20.7242932817944, 16.2002061581438);
  688. glVertex2f(20.7242932817944, 13.7482168358247);
  689. glEnd();
  690. glFlush();
  691.  
  692. //jendela 4
  693. glColor3f(1.00, 1.00, 0.20);
  694. glBegin(GL_POLYGON);
  695. glVertex2f(31.9374696626437, 25.3699828721337);
  696. glVertex2f(31.9374696626437, 27.8219721944528);
  697. glVertex2f(34.3894589849628, 27.8219721944528);
  698. glVertex2f(34.3894589849628, 25.3699828721337);
  699. glEnd();
  700. glFlush();
  701.  
  702. //jendela 5
  703. glColor3f(1.00, 1.00, 0.20);
  704. glBegin(GL_POLYGON);
  705. glVertex2f(31.9701621292047, 19.6161087574081);
  706. glVertex2f(31.9701621292047, 22.0680980797272);
  707. glVertex2f(34.4221514515238, 22.0680980797272);
  708. glVertex2f(34.4221514515238, 19.6161087574081);
  709. glEnd();
  710. glFlush();
  711.  
  712. //jendela 6
  713. glColor3f(1.00, 1.00, 0.20);
  714. glBegin(GL_POLYGON);
  715. glVertex2f(32.0355470623266, 13.8295421761215);
  716. glVertex2f(32.0355470623266, 16.2815314984406);
  717. glVertex2f(34.4875363846457, 16.2815314984406);
  718. glVertex2f(34.4875363846457, 13.8295421761215);
  719. glEnd();
  720. glFlush();
  721.  
  722. //jendela besar rumah1 1
  723. glColor3f(0.00, 0.00, 0.00);
  724. glBegin(GL_POLYGON);
  725. glVertex2f(24.1166690442812, 25.5255028566319);
  726. glVertex2f(24.1166690442812, 27.977492178951);
  727. glVertex2f(28.7686583666003, 27.977492178951);
  728. glVertex2f(28.7686583666003, 25.5255028566319);
  729. glEnd();
  730. glFlush();
  731.  
  732. //jendela besar rumah1 2
  733. glColor3f(0.00, 0.00, 0.00);
  734. glBegin(GL_POLYGON);
  735. glVertex2f(24.1372191772075, 19.6575413746567);
  736. glVertex2f(24.1372191772075, 22.1095306969758);
  737. glVertex2f(28.7892084995266, 22.1095306969758);
  738. glVertex2f(28.7892084995266, 19.6575413746567);
  739. glEnd();
  740. glFlush();
  741.  
  742. //jendela besar rumah1 3
  743. glColor3f(0.00, 0.00, 0.00);
  744. glBegin(GL_POLYGON);
  745. glVertex2f(24.1694254028489, 13.7936993468023);
  746. glVertex2f(24.1694254028489, 16.2456886691214);
  747. glVertex2f(28.821414725168, 16.2456886691214);
  748. glVertex2f(28.821414725168, 13.7936993468023);
  749. glEnd();
  750. glFlush();
  751.  
  752. //pintu rumah1
  753. glColor3f(0.00, 0.00, 0.00);
  754. glBegin(GL_POLYGON);
  755. glVertex2f(23.9932204416424, 4.019791369435);
  756. glVertex2f(23.9932204416424, 9.3717806917541);
  757. glVertex2f(28.6452097639615, 9.3717806917541);
  758. glVertex2f(28.6452097639615, 4.019791369435);
  759. glEnd();
  760. glFlush();
  761.  
  762. ////------------gedung 2--------------/////
  763. glColor3f(0.70, 0.75, 0.71);
  764. glBegin(GL_POLYGON);
  765. glVertex2f(63.177182086235, 4.0498582903215);
  766. glVertex2f(63.177182086235, 32.1498582903215);
  767. glVertex2f(85.777182086235, 32.1498582903215);
  768. glVertex2f(85.777182086235, 4.0498582903215);
  769. glEnd();
  770. glFlush();
  771.  
  772. //jendela 1
  773. glColor3f(0.00, 0.00, 0.00);
  774. glBegin(GL_POLYGON);
  775. glVertex2f(66.4280728630853, 25.6420228971954);
  776. glVertex2f(66.4280728630853, 28.0940122195145);
  777. glVertex2f(68.8800621854044, 28.0940122195145);
  778. glVertex2f(68.8800621854044, 25.6420228971954);
  779. glEnd();
  780. glFlush();
  781.  
  782. //jendela 2
  783. glColor3f(1.00, 1.00, 0.20);
  784. glBegin(GL_POLYGON);
  785. glVertex2f(66.3537713360208, 19.6979007320387);
  786. glVertex2f(66.3537713360208, 22.1498900543578);
  787. glVertex2f(68.8057606583399, 22.1498900543578);
  788. glVertex2f(68.8057606583399, 19.6979007320387);
  789. glEnd();
  790. glFlush();
  791.  
  792. //jendela 2
  793. glColor3f(1.00, 1.00, 0.20);
  794. glBegin(GL_POLYGON);
  795. glVertex2f(66.3537713360208, 19.6979007320387);
  796. glVertex2f(66.3537713360208, 22.1498900543578);
  797. glVertex2f(68.8057606583399, 22.1498900543578);
  798. glVertex2f(68.8057606583399, 19.6979007320387);
  799. glEnd();
  800. glFlush();
  801.  
  802. //jendela 3
  803. glColor3f(1.00, 1.00, 0.20);
  804. glBegin(GL_POLYGON);
  805. glVertex2f(66.5766759172142, 13.9023816210109);
  806. glVertex2f(66.5766759172142, 16.35437094333);
  807. glVertex2f(69.0286652395333, 16.35437094333);
  808. glVertex2f(69.0286652395333, 13.9023816210109);
  809. glEnd();
  810. glFlush();
  811.  
  812. //jendela 4
  813. glColor3f(1.00, 1.00, 0.20);
  814. glBegin(GL_POLYGON);
  815. glVertex2f(80.2481568970748, 25.6420228971954);
  816. glVertex2f(80.2481568970748, 28.0940122195145);
  817. glVertex2f(82.7001462193939, 28.0940122195145);
  818. glVertex2f(82.7001462193939, 25.6420228971954);
  819. glEnd();
  820. glFlush();
  821.  
  822. //jendela 5
  823. glColor3f(1.00, 1.00, 0.20);
  824. glBegin(GL_POLYGON);
  825. glVertex2f(80.2123788293953, 19.7338985689341);
  826. glVertex2f(80.2123788293953, 22.1858878912532);
  827. glVertex2f(82.6643681517145, 22.1858878912532);
  828. glVertex2f(82.6643681517145, 19.7338985689341);
  829. glEnd();
  830. glFlush();
  831.  
  832. //jendela 6
  833. glColor3f(0.00, 0.00, 0.00);
  834. glBegin(GL_POLYGON);
  835. glVertex2f(80.2850123226567, 14.032169347923);
  836. glVertex2f(80.2850123226567, 16.4841586702421);
  837. glVertex2f(82.7370016449758, 16.4841586702421);
  838. glVertex2f(82.7370016449758, 14.032169347923);
  839. glEnd();
  840. glFlush();
  841.  
  842. //jendela besar 1
  843. glColor3f(1.00, 1.00, 0.20);
  844. glBegin(GL_POLYGON);
  845. glVertex2f(72.1664885100119, 25.5170060689998);
  846. glVertex2f(72.1664885100119, 27.9689953913189);
  847. glVertex2f(76.818477832331, 27.9689953913189);
  848. glVertex2f(76.818477832331, 25.5170060689998);
  849. glEnd();
  850. glFlush();
  851.  
  852. //jendela besar 2
  853. glColor3f(1.00, 1.00, 0.20);
  854. glBegin(GL_POLYGON);
  855. glVertex2f(72.1186550669397, 19.6986161578653);
  856. glVertex2f(72.1186550669397, 22.1506054801844);
  857. glVertex2f(76.7706443892588, 22.1506054801844);
  858. glVertex2f(76.7706443892588, 19.6986161578653);
  859. glEnd();
  860. glFlush();
  861.  
  862. //jendela besar 3
  863. glColor3f(1.00, 1.00, 0.20);
  864. glBegin(GL_POLYGON);
  865. glVertex2f(72.1567930427048, 13.8635058658061);
  866. glVertex2f(72.1567930427048, 16.3154951881252);
  867. glVertex2f(76.8087823650239, 16.3154951881252);
  868. glVertex2f(76.8087823650239, 13.8635058658061);
  869. glEnd();
  870. glFlush();
  871.  
  872. //pintu
  873. glColor3f(0.00, 0.00, 0.00);
  874. glBegin(GL_POLYGON);
  875. glVertex2f(72.0720115699144, 4.0426982071601);
  876. glVertex2f(72.0720115699144, 9.4946875294792);
  877. glVertex2f(76.7240008922335, 9.4946875294792);
  878. glVertex2f(76.7240008922335, 4.0426982071601);
  879. glEnd();
  880. glFlush();
  881.  
  882.  
  883.  
  884. //tanah
  885. glColor3f(0.33, 0.33, 0.33);
  886. glBegin(GL_POLYGON);
  887. glVertex2f(-30, -30);
  888. glVertex2f(-30, 4);
  889. glVertex2f(100, 4);
  890. glVertex2f(100, -30);
  891. glEnd();
  892. glFlush();
  893.  
  894.  
  895. //perintah animasi
  896. glPushMatrix();
  897. glTranslatef(gerak, 0, 0);
  898.  
  899. /*
  900. glColor3f(0.0, 1.0, 1.0);
  901. glBegin(GL_POLYGON);
  902. glVertex2f(1.0, 1.0);
  903. glVertex2f(1.5, 0.0);
  904. glVertex2f(1.5, -1.0);
  905. glVertex2f(-1.0, -1.0);
  906. glVertex2f(-1.0, 0.0);
  907. glVertex2f(-0.7, 1.0);
  908. glEnd();
  909. glFlush();
  910.  
  911. */
  912.  
  913.  
  914. glColor3f(255.0, 255.0, 0.0);
  915. glBegin(GL_POLYGON);
  916.  
  917. radius = 400;
  918. jumlah_titik = 300;
  919. x_tengah = 100;
  920. y_tengah = 8000;
  921.  
  922. for (i = 0; i <= 360; i++)
  923. {
  924. float sudut = i * (2 * PI / jumlah_titik);
  925. float x = x_tengah + radius * cos(sudut);
  926. float y = y_tengah + radius * sin(sudut);
  927. glVertex2f(x / 100, y / 100);
  928. }
  929.  
  930. glEnd();
  931. glFlush();
  932.  
  933. glPopMatrix();
  934.  
  935.  
  936. }
  937. void timer(int t)
  938. {
  939.  
  940. gerak += 1;
  941.  
  942.  
  943. glutPostRedisplay();
  944. glutTimerFunc(130, timer, 0);
  945. }
  946.  
  947. void timeer(int value)
  948. {
  949. glutTimerFunc(9999999, timeer, 0);
  950. glutPostRedisplay();
  951. }
  952.  
  953. void display() {
  954. glClear(GL_COLOR_BUFFER_BIT);
  955. tampil();
  956. glFlush();
  957. glutSwapBuffers();
  958. }
  959.  
  960. int main(int argc, char** argv)
  961. {pa
  962. glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB);
  963. glutInitWindowSize(600, 600);
  964. glutCreateWindow("Bulan");
  965. glutPostRedisplay();
  966. glutDisplayFunc(display);
  967. gluOrtho2D(-20., 100., -20.0, 100.0);
  968. // glutTimerFunc(0, timeer, 0);
  969. glutTimerFunc(0, timer, 0);
  970. glutMainLoop();
  971.  
  972. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement