This project includes Python scripts for basic computer graphics techniques including ray tracing, 3D-to-2D projection, and 2D shape visualization.
Install all necessary dependencies with:
pip install numpy matplotlib pillowPerforms ray tracing to render a 3D scene with spheres, a white plane, and a face mesh.
- Input:
face-vertices.dataorface-vertices copy.data - Output: Rendered image (e.g.,
output.png) - Run:
python RayTracing.py
Projects 3D vertices onto a 2D plane using orthographic or perspective projection.
- Input:
face-vertices.data - Output: 2D plot displayed with Matplotlib
- Run:
python Projection.py
These files contain 3D vertex coordinates of a face mesh.
- Used by:
RayTracing.pyandProjection.py - Format: Likely one vertex per line (e.g.,
x y z) - Do not run directly.
Generates and displays a 2D circle using NumPy and Matplotlib.
- Output: A Matplotlib window displaying a circle.
- Run:
python Circle.py
- These scripts are designed to be run from the command line or a Python IDE such as Visual Studio Code.
- Ensure that the
.datafiles are located in the same directory as the scripts. - This code is intended for educational and experimental use.