3D-engine-from-scraph--pygame
3D Engine from scratch with python using pygame.
Package Requirement
PYGAME -> pip install pygame
COLORSYS -> pip install colorsys
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 zsorting isn't working properly
Directional Light
light = Light(position)
# to disable the light in the scene you can set the light = None
light = None
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
Display normals:
ShowNormals = True
# you can set the normal lines length in the world.py file
Camera clipping
it's 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.
Wireframe Mode
wireframe = True
Display Point Vertices
vertices = True
Display Axis
showAxis = True
red-> x axis
green-> y axis
blue-> z axis
utah teapot
GitHub
https://github.com/Josephbakulikira/3D-engine-from-scraph--pygame