graphics-autumn-windmill
graphics-autumn-windmill
Introduction
This “Autumn Windmill” project is developed by WaterCoFire for the DIICSU DI41008 - Graphics module assignments. Built entirely using C++ and modern OpenGL, this project simulates a fully interactive, three-dimensional environment capturing the serene atmosphere of a rustic autumn landscape. The primary objective was to move beyond simple object rendering to create a cohesive world that integrates procedural geometry, hierarchical animation, and robust asset management pipelines.
If you are a DIICSU Comp Sci student
This project is for reference only. It lacks creativity, and WaterCoFire strongly encourages you to create originally.

Hybrid Geometry Pipeline
A distinct feature of this project is its hybrid approach to geometry generation, which balances manual control with algorithmic efficiency. Rather than relying exclusively on imported meshes, the core structures—specifically the windmill tower and cap—are defined through hard-coded vertex arrays to ensure precise architectural control. However, to demonstrate mathematical versatility, complex components such as the windmill’s hub and the smoking chimney were generated programmatically. By utilizing trigonometric functions within the main execution loop, the application dynamically constructs cylinders with variable segment counts, calculating smooth vertex normals for curved surfaces while maintaining flat normals for end-caps to ensure correct shading behavior.
Scene Composition and Environment
As the project evolved from a singular object study into a comprehensive scene, the environment was significantly expanded to include a diverse range of assets. Leveraging the Assimp (Open Asset Import Library), the system ingests external .obj models, successfully populating the landscape with a rustic cabin, wooden benches, and various stylistic trees. To unify these elements into a believable “autumn” world, a skybox was implemented using a cube map texture. A specific depth optimization technique (forcing z=w in the vertex shader) ensures the skybox always renders at the maximum depth, while the ground utilizes GL_REPEAT wrapping modes with high-range texture coordinates to create an expansive, detailed terrain without texture stretching.
Hierarchical Kinematics
Bringing the scene to life required a robust hierarchical transformation system, specifically designed to handle the complex mechanics of the windmill. The scene graph logic dictates that the windmill’s main body (the tower and cap) rotates around the global Y-axis to simulate orientation changes. Crucially, the blades and the central hub are children of the cap; they inherit this global rotation while simultaneously possessing their own local Z-axis rotation. This implementation resolved early challenges where independent rotations led to spatial misalignment, ensuring that the hub spins perfectly in place regardless of the windmill’s orientation relative to the camera.
Advanced Rendering and Visual Effects
The visual fidelity of the project is powered by a custom Phong lighting model implemented in the fragment shader, which calculates ambient, diffuse, and specular components per pixel. A critical technical detail was the introduction of a Normal Matrix to correct normal vectors transformed by non-uniform scaling—without this, the lighting on the stretched windmill tower would appear distorted. To further enhance realism, a particle system was engineered to simulate smoke rising from the cabin. Utilizing Instanced Rendering, the system draws thousands of particles in a single call. These particles employ “Billboarding” techniques to ensure they always face the camera, coupled with distance-based sorting and alpha blending to handle transparency without rendering artifacts.
Interactive User Experience
While the initial iteration of the project relied on complex keyboard shortcuts, the final release integrates the Dear ImGui framework to offer a professional graphical user interface. This upgrade transformed the debugging and presentation experience, allowing users to manipulate scene parameters in real-time.
Accessing
This project has been open-sourced on GitHub.
For reference only. Please consciously refrain from all infringement of others’ IP rights as well as academic misconduct.
References
All third-party resources used can be found in the README in the GitHub repository of this project.
