This project is a basic wireframe 3D renderer built in Python using NumPy and Pygame. The program renders a simple 3D house model and allows the user to navigate through the scene using keyboard controls.
The purpose of this assignment is to demonstrate core computer graphics concepts including:
- World-to-camera transformations
- Perspective projection
- Viewport transformations
- Interactive camera movement in 3D space
- Renders a wirefram 3D house model
- Perspective projection using a custom projection matrix
- Interactive first-person camera movement Viewport transformation to screen coordinates
- Python
- NumPy
- Pygame
pip install pygame
pip install numpypython Lab3-3DProjection.py| Key | Action |
|---|---|
| W | Move Forward |
| S | Move Backward |
| A | Move Left |
| D | Move Right |
| Q | Turn Left |
| E | Turn Right |
| R | Move Up |
| F | Move Down |
| H | Reset Camera to Home Position |
buildProjectionMatrix()
Creates a single transformation matrix combining:
- World-to-camera transformation
- Perspective projection matrix
toScreen(point)
Converts projected homogeneous coordinates into screen coordinates by:
- Performing homogeneous divide
- Applying viewport transformation
After completing this project, I gained experience with:
- 3D graphics pipelines
- Matrix transformations
- Real-time rendering logic
- Interactive controls in Pygame
- Camera systems used in modern game engines
This project was built for a Computer Graphics coursework assignment focused on understanding the mathematics behind 3D rendering pipelines.