Grafika Komputer — Algoritma DDA, Bresenham & Midpoint Circle
Aplikasi desktop interaktif menggunakan Raylib dan C yang mendemonstrasikan sepuluh program gambar garis dan lingkaran berbasis algoritma rasterisasi klasik, serta 5 modul challenge tambahan.
Catatan penting: Tidak ada fungsi gambar garis/lingkaran bawaan Raylib yang digunakan. Setiap piksel digambar menggunakan
DrawPixel()dari implementasi DDA, Bresenham, atau Midpoint Circle yang ditulis sendiri.
| Program | Tombol | Algoritma | Deskripsi |
|---|---|---|---|
| 1 | Q | DDA | Diagram Kartesian — garis lurus pada sumbu XY |
| 2 | W | DDA | Berbagai style garis (normal, dash, tebal, dash-dot) |
| 3 | E | Bresenham | Diagram Kartesian — garis lurus pada sumbu XY |
| 4 | R | Bresenham | Berbagai style garis (normal, dash, tebal, dash-dot) |
| 5 | T | DDA | Teks 'FATHIN' — Menggambar teks dengan algoritma DDA |
| 6 | Y | Midpoint Circle | Lingkaran dengan 8-way symmetry (integer only) |
| 7 | U | Midpoint Circle | Flower of Life Pattern — pola geometri sakral |
| 8 | I | Midpoint Circle | Animated Flower of Life — transisi lingkaran ke lensa |
| 9 | O | Midpoint Circle | Vesica Piscis Statis (4 Kelopak Murni) |
| 10 | P | Midpoint Circle | Vesica Piscis Shift (Pergeseran Jari-Jari) |
Terdapat 5 modul challenge tambahan yang dapat diakses melalui halaman About:
| Modul | Deskripsi |
|---|---|
| 1 | Challenge Midpoint Circle |
| 2 | Challenge Flower of Life |
| 3 | Challenge Animated Vesica Piscis |
| 4 | Challenge Vesica Piscis Statis |
| 5 | Challenge Vesica Piscis Shift |
Kode sumber dipisah menjadi modul-modul yang mandiri:
├── main.c ← Entry point, main loop
├── screen_type.h ← Enum Screen & konstanta layar
├── coords.h / coords.c ← Konversi koordinat CS_X(), CS_Y()
│
├── src/algo/
│ ├── dda.h + dda.c ← DDALine, DDA_DashedLine, DDA_ThickLine, DDA_DashDotLine
│ ├── bresenham.h + bresenham.c ← BresenhamLine, Bres_DashedLine, Bres_ThickLine, Bres_DashDotLine
│ └── midcircle.h + midcircle.c ← Midcircle, MidcircleFilled, MidcircleThick, MidcircleDashed
│
├── src/ui/
│ ├── primitives.h + primitives.c ← DrawDot
│ ├── back_button.h + back_button.c ← DrawBackButton, BackButtonPressed
│ └── cartesian.h + cartesian.c ← DrawCartesianGrid, DrawCoordInfo
│
├── src/screens/
│ ├── program1.h + program1.c ← DDA Kartesian
│ ├── program2.h + program2.c ← DDA Style Garis
│ ├── program3.h + program3.c ← Bresenham Kartesian
│ ├── program4.h + program4.c ← Bresenham Style Garis
│ ├── program5.h + program5.c ← Teks FATHIN (DDA)
│ ├── program6.h + program6.c ← Midpoint Circle
│ ├── program7.h + program7.c ← Flower of Life Pattern
│ ├── program8.h + program8.c ← Animated Flower of Life
│ ├── program9.h + program9.c ← Vesica Piscis Statis
│ ├── program10.h + program10.c ← Vesica Piscis Shift
│ ├── modul1.h + modul1.c ← Modul Challenge 1
│ ├── modul2.h + modul2.c ← Modul Challenge 2
│ ├── modul3.h + modul3.c ← Modul Challenge 3
│ ├── modul4.h + modul4.c ← Modul Challenge 4
│ ├── modul5.h + modul5.c ← Modul Challenge 5
│ ├── about.h + about.c ← Halaman About
│ └── menu.h + menu.c ← Menu Utama
│
├── docs/
│ ├── PROGRAM5_MIDCIRCLE.md ← Dokumentasi algoritma Midpoint Circle
│ ├── PROGRAM6_FLOWER_OF_LIFE.md ← Dokumentasi Flower of Life Pattern
│ ├── PROGRAM7_VESICA_PISCIS.md ← Dokumentasi Animated Vesica Piscis
│ ├── PROGRAM8_VESICA_PISCIS_STATIS.md ← Dokumentasi Vesica Piscis Statis
│ ├── PROGRAM9_QUARTER_ARC_VESICA.md ← Dokumentasi Vesica Piscis Pergeseran Jari-Jari
│ └── PROGRAM8_VS_PROGRAM9_PERBANDINGAN.md ← Perbandingan Program 8 & 9
│
├── Makefile ← Build Linux/macOS (pkg-config)
├── Makefile.win ← Build Windows (MinGW + raylib manual)
└── README.md ← Dokumentasi ini
make run make -f Makefile.win <- hanya build
make -f Makefile.win run <- build + jalankan
make -f Makefile.win clean <- hapus hasil buildPastikan Raylib sudah diunduh dan sesuaikan path di Makefile.win (lihat komentar di dalamnya).
- Bahasa: C (GCC / MinGW)
- Library: Raylib 5.5
- Build: GNU Make + pkg-config (Linux) / Makefile.win (Windows)
- Display: VNC desktop (Linux) / Window native (Windows)