Skip to content

Josephbakulikira/3D-engine-from-scraph--pygame

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

95 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

3D ENGINE WITH PYTHON FROM SCRATCH

ko-fi

Youtube Channel: https://www.youtube.com/c/Auctux [auctux | YouTube]


Package Requirement

pip install -r requirements-dev.txt

Development Setup

pip install -r requirements-dev.txt
pre-commit install

Bugs (unsolved issues)

  • The z sorting of triangles still has some noticeable issues
  • still need some optimization to run faster ( maybe using numpy matrices can help a little bit)
  • issues with translate matrix , gonna fix it later still trying a couple of things

Support .obj files although the z-sorting isn't working properly

DeerGIF

Directional lighting

light = Light(position)
# to disable the light in the scene you can set the light = None
light = None

Directional LightGIF

Controls

Might work on a much better controls later but for now to move around the scene you can use "WASD" and "Arrows". The controls are weird , I'm gonna try to improve them.


Parameters

Screenshot (132)


Display normals:

ShowNormals = True
# you can set the normal lines length in the world.py file

normalsGIF


Camera Clipping

It still has a couple of issues when it comes to the boundary clipping , since it's only clip the faces that are in front of the camera.

clippingGIF


Wireframe Mode

wireframe = True

wireframe


Display Point Vertices

vertices = True

cube


Display Axis

showAxis = True
# red: x axis
# green: y axis
# blue: z axis

ezgif com-gif-maker (4)


icosphereGIG

Utah Teapot

Screenshot (131)


Enjoy✌

Subscribe to my YouTube