Coursework repository for ECE433 — Computer Graphics at the University of Thessaly. The repository covers raster graphics, antialiasing, scanline polygon filling, clipping, OpenGL/GLUT, 2D/3D transformations, lighting, texturing, culling, and a substantially extended final 3D scene project.
The main portfolio piece is Homework 3 / Project 3: Visiting a 3D House: a first-person OpenGL scene that grew beyond the assignment into a small modular rendering/game framework with hierarchical objects, hot-reloadable assets, dynamic lighting, textured models, transparent windows, a day/night cycle, NURBS terrain features, and multiple camera/view modes.
| Area | What is included |
|---|---|
| Rasterization | Bresenham-style lines, Xiaolin Wu-style antialiasing, circles, filled circles, interactive drawing tools. |
| Polygon algorithms | Scanline polygon filling, RGB interpolation, Sutherland-Hodgman clipping, interactive polygon/clipping demos. |
| Transformations | Written 2D/3D homogeneous-coordinate transformation exercises and worked examples. |
| OpenGL scene work | Lighting, materials, texture mapping, culling, camera navigation, multi-viewport rendering. |
| Final project | A furnished, explorable 3D house and outdoor environment with a custom scene/object framework. |
The assignment asked for a 3D house or 3D space with transformations, modeling, hidden-surface removal, lighting, texture mapping, a moving camera, and a separate view-rendering program. This implementation goes much further:
- Hierarchical object system:
Objectsupports parent/child composition, recursive transforms, polymorphic drawing throughdrawInternal(), and grouped scene objects such as rooms, furniture, lanterns, framed windows, and the full house. - Display-list optimization: static objects can be compiled into OpenGL display lists, avoiding repeated expensive redraw setup for heavy geometry.
- Transparency pipeline: transparent objects are tracked separately and sorted relative to the camera before rendering, used for glass/window rendering and masked textures.
- Manager-based architecture: separate managers coordinate game state, window setup, input, lighting, materials, textures, assets, and global scene lifecycle.
- First-person camera: WASD movement, mouse-look or keyboard-look modes, optional flight mode, frame-rate-independent motion via delta time, fullscreen toggling, and an attachable flashlight.
- Dynamic lighting: global ambient light, multiple local lights, a camera-following flashlight, lantern/portal lighting, and a time-varying sun/moon system.
- Day/night environment: sun and moon objects orbit the scene while the sky color and light color update over time.
- Textured house and environment: floors, walls, posters, grass, stone, glass, Minecraft-style blocks, and imported/converted texture assets.
- Hot-reloadable assets: many pieces of furniture and scene objects are described in text files and loaded through a custom
AssetLoader, so placement can be edited without recompiling. - OBJ model support:
Modelloads external.objgeometry, including the detailed car model used in the garage scene. - Procedural/NURBS geometry: a reusable
SplineObject/NurbsCurve/NurbsSurfacelayer wraps GLU NURBS. It is used for the mountainous horizon and curved objects such as the garden hose. - Two executable views:
visiting3Dhouseprovides the navigable first-person experience, whileviewspresents orthographic/perspective floor-plan, roof, exterior, and rotating interior views.
Handouts and recovered reports are collected under docs/handouts/ and docs/reports/. Homework 1 and Homework 3 use subfolders because they include multiple handout/supporting PDFs.
| Path | Description |
|---|---|
homework-1-rasterization-antialiasing/ |
Rasterization exercises: line drawing, antialiasing, circles, filled circles, OpenGL examples, pseudocode, the project handout, and antialiasing notes. |
homework-2-polygon-fill-clipping/ |
Polygon filling, color interpolation, 2D/3D transformation theory, Sutherland-Hodgman clipping, an interactive gradient polygon filler, and an interactive polygon clipping tool. |
homework-3-3d-house/ |
Lighting/texturing/culling lecture examples plus the final 3D house simulation in final-3d-house/. |
docs/images/ |
Selected final-project screenshots used by this README. |
Homework 1 starts with lower-level raster graphics algorithms before moving to interactive OpenGL programs.
Implemented/reported work includes:
- Bresenham-style line drawing.
- Xiaolin Wu-style antialiased line drawing.
- Circle and filled-circle rasterization.
- Object storage for interactive drawing.
- Mouse-driven point/line/circle creation.
- Keyboard-controlled drawing color and mode selection.
Useful paths:
docs/handouts/homework-1-rasterization-antialiasing/project-handout.pdfdocs/reports/homework-1-rasterization-antialiasing-report.pdfdocs/handouts/homework-1-rasterization-antialiasing/antialiasing-notes.pdfhomework-1-rasterization-antialiasing/exercise-4-antialiased-lines/homework-1-rasterization-antialiasing/exercise-5-circle-drawing/
Homework 2 combines written transformation/clipping exercises with two interactive OpenGL implementations.
Implemented/reported work includes:
- Scanline polygon filling using an active-edge table/list.
- RGB color interpolation along polygon edges and across scanlines.
- Sutherland-Hodgman polygon clipping pseudocode and worked examples.
- Interactive polygon input with per-vertex colors.
- Interactive clipping-window selection and polygon clipping.
- Optional fill toggling for clipped polygons.
Useful paths:
docs/handouts/homework-2-polygon-fill-clipping.pdfdocs/reports/homework-2-polygon-fill-clipping-report.pdfhomework-2-polygon-fill-clipping/exercise-11-gradient-polygon-fill/homework-2-polygon-fill-clipping/exercise-12-interactive-polygon-clipping/
Homework 3 is the final project and the deepest implementation in the repository. It contains lecture/lab examples for lighting, texturing, culling, and camera movement, then the full 3D house simulation.
Useful paths:
docs/handouts/homework-3-3d-house/project-handout.pdfdocs/reports/homework-3-3d-house-report.pdfhomework-3-3d-house/final-3d-house/src/homework-3-3d-house/final-3d-house/assets/homework-3-3d-house/final-3d-house/textures/
The final project is a C++/OpenGL/GLUT project. A normal Linux OpenGL/X11 development toolchain is recommended.
On Debian/Ubuntu-like systems:
sudo apt install build-essential freeglut3-dev libglew-dev libgl1-mesa-dev libglu1-mesa-dev libx11-devBuild the final project:
cd homework-3-3d-house/final-3d-house/src
make clean
make all -j"$(nproc)"Run the first-person simulation from the final-project root so asset paths resolve correctly:
cd ..
target/linux/visiting3Dhouse .Run the multi-view renderer:
target/linux/views .If mouse warping is blocked by your window manager, build with keyboard-only camera rotation:
cd homework-3-3d-house/final-3d-house/src
make clean
make all -j"$(nproc)" USE_MOUSE=0| Action | Mouse-look mode | Keyboard-look mode |
|---|---|---|
| Move | W, A, S, D |
W, A, S, D |
| Fly up / down | Space / Z |
Space / Z |
| Look around | Mouse movement | I, J, K, L |
| Toggle flight mode | F |
F |
| Toggle flashlight | E |
E |
| Reload text assets | R |
R |
| Toggle fullscreen | F11 |
F11 |
| Quit | ESC or Q |
ESC or Q |





