https://youtu.be/vepaVo9sTKY?si=pkr0jEDA_eNBYDOl
An interactive application developed in C++ and SFML that visualizes the creation of beautiful roses through simple polar equations.
Building upon the foundational principles of my "Trigonometry and Polar Coordinates" project, this application was created to explore the fascinating world of procedural art. The goal was to build an interactive tool that allows users to manipulate mathematical parameters in real-time and witness how simple formulas can generate intricate and aesthetically pleasing patterns. This project serves as a practical study in procedural generation and the power of mathematics in computer graphics.
- Real-time Procedural Generation: The rose patterns are generated and drawn live on the screen, responding instantly to user input.
- Interactive Parameters: Users can dynamically change the
nanddinteger values of the rose equation (k = n/d) to explore a vast catalog of different patterns. - Polar to Cartesian Conversion: Core to the visualization, the application continuously converts polar coordinates (
radius,angle) into Cartesian coordinates (x,y) for rendering with SFML. - User Feedback: The current
n(red) andd(blue) values are displayed on the screen, providing clear visual feedback to the user.
This project was a profound lesson in the core principles of procedural generation.
-
Emergent Complexity: The most significant takeaway was seeing how a very simple set of rules—the polar equations—could produce an enormous variety of complex and unpredictable patterns. It was a tangible demonstration of how complexity can emerge from simplicity.
-
Connection to Graphics: This principle is fundamental in modern computer graphics. Procedural generation is used to create everything from realistic textures (like wood grain or marble) and natural landscapes to complex visual effects in games and film. This project provided a hands-on understanding of this powerful technique.
-
Building Interactive Tools: Beyond just implementing an algorithm, I learned to create an interactive experience. Designing the user input (
nanddkeys) and providing on-screen feedback was a great exercise in creating a simple but effective user interface.
This project was developed on Windows using Visual Studio 2022.
- Clone the Repository:
git clone https://github.com/tuananohut/Interactive-Mathematical-Rose-Visualization.git
- Run from Visual Studio:
- Open the
.slnsolution file in Visual Studio. - Set the solution configuration to Release and platform to x64.
- Build and run the project (F5).
- Open the
- Run Pre-compiled Executable:
- Alternatively, you can run the pre-compiled
.exefile located in the/x64/Release/directory. - Note on Font Rendering: There is a known issue with the font failing to load in the current executable, which I plan to fix. The core visualization works perfectly.
- Alternatively, you can run the pre-compiled
- Press the
Nkey to increment the n value (shown in red). - Press the
Dkey to increment the d value (shown in blue).
The mathematical concepts and inspiration for this project came from these excellent resources:
- Wikipedia: Rose (mathematics)
- The Coding Train: Coding Challenge #55: Mathematical Rose
