Skip to content

amsu21/Computer-Graphics-Assignment4

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Lab 4 - Basic Wireframe 3D Renderer

Overview

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

Features

  • Renders a wirefram 3D house model
  • Perspective projection using a custom projection matrix
  • Interactive first-person camera movement Viewport transformation to screen coordinates

Technologies Used

  • Python
  • NumPy
  • Pygame

Installation

pip install pygame
pip install numpy

How to Run

python Lab3-3DProjection.py

Camera Controls

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

Major Functions

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

Learning Outcomes

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

Notes

This project was built for a Computer Graphics coursework assignment focused on understanding the mathematics behind 3D rendering pipelines.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages