A simple pygame 3D engine
Project description
3D-Engine-for-pygame
Report by Arman Kiani.
- This projects contains a 3D render engine for python, made in 4 days. Two files are created for viewing flexibility and capability of engine, showing it can be used for any project / game with the right adjustment.
-
showcase/pygame viewer.py general visualization of engine capabilities like collision detection and direct obj file importing.
-
Minecraft/pygame viewer.py shows flexibility of the engine being used in a simple real life game.
Controls: Mouse: Look wasd: move R click, L click: Place, break block / Shoot L shift: Run Space: Jump
Down sides:
Doesnt support gpu acceleration, resulting in performance issues for big projects. Projection bug for objects behind the camera. (needs cutting and generating new vertices which gets advanced) doesn't support textures and advanced lighting.
Summery:
There is room for a lot of improvements due to code clarity and use of OOP programing.
Best wishes, Arman Kiani :)
Additional info about engine functionality:
- Render method / algorithm: Projection
- Moving: Shifting the world,
- Rotating the camera: rotating the world around camera (matrix multiplication).
- Rendering faces and edges: Vertex look up + pygame polygon and draw.line()
- Efficiency: blocking objects behind the camera (not rendered).
- Render priority: averaging face vertices z dimension.
- Shading: standard deviation of vertices z dimension and mixing color by shadow color (smart simple approach simulationg light).
- collision detection: checking 2D polygon renders.
- Shadows: clipping y to ground level for all vertices.
- Ability to importi obj files directly with one command!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pygame_3d_engine-0.1.0.tar.gz.
File metadata
- Download URL: pygame_3d_engine-0.1.0.tar.gz
- Upload date:
- Size: 7.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b93ecbab828cce4bc2ee4c8fa8b7d22d62617d8365c762cf36ea54cc4f5afae8
|
|
| MD5 |
9ac97afd606b819163a0eb0c9f576c05
|
|
| BLAKE2b-256 |
c5a355e88f7753d99fdd6a02cc54f4f73e64931fffe7a38e2f5ab3ee80627bbb
|
File details
Details for the file pygame_3d_engine-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pygame_3d_engine-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3f6ca9159121bfecefaa6dc199205044619b32410e053986b77280d182776f8f
|
|
| MD5 |
f18c2fcddf1954a99fa9d7b812579d34
|
|
| BLAKE2b-256 |
427b016e56be7399a983798959ac0a36b5fcbe87abe2707c179f359d1c973d8a
|