This project is a 2D computer graphics simulation developed for Computer Graphics Course. It demonstrates the use of fundamental OpenGL primitives to construct a scene and implement 2D animation logic.
The simulation renders a house using GL_TRIANGLES and GL_LINES and features a continuous rainfall animation. Users can interact with the system to simulate wind (bending the rain) and change the time of day.The application allows users to interact with the environment in real-time, controlling wind direction to bend the rain and toggling between day and night modes.
The simulation uses the keyboard for interaction:
| Key | Function | Description |
|---|---|---|
| Right Arrow (→) | Wind Right | Bends the rain angle to the right (Max 45°). |
| Left Arrow (←) | Wind Left | Bends the rain angle to the left (Max -45°). |
d |
Day Mode | Gradually lightens the sky/background. |
n |
Night Mode | Gradually darkens the sky/background. |
You need Python installed along with the PyOpenGL library.
- Install Python (if not already installed).
- Install the OpenGL libraries using pip:
pip install PyOpenGL PyOpenGL_accelerate
This project requires Python and the PyOpenGL library. If you haven't installed the library yet, run this command in your terminal or command prompt:
pip install PyOpenGL PyOpenGL_accelerateOnce the dependencies are installed, you can run the project by executing the python file:
python src/OpenGL-House-Rainfall-Simulation.py.
├── src/
│ └── OpenGL-House-Rainfall-Simulation.py # Main simulation source code
├── requirements.txt # List of required Python libraries
├── .gitignore # Config file to ignore unnecessary local files
└── README.md # Project documentation
- Md. Fuadur Rahman
This project is for educational purposes.