soup3D
A 3D engine based on OpenGL and pygame that is easy for beginners to learn, and can be used for 3D game development, data visualization, 3D graphics rendering, and other development tasks.
Installation
If your python environment includes pip, you can install it using the following command:
pip install soup3D
Quick Start
After installation, you can try this code:
import soup3D # 3D rendering library
import pygame # pygame window library for displaying soup3D rendered images
if __name__ == '__main__':
pygame.init() # Initialize pygame
pygame.display.set_caption("soup3D") # Set pygame window title
pygame.display.set_mode((1920, 1080), pygame.DOUBLEBUF | pygame.OPENGL) # Configure window mode
soup3D.init(bg_color=(1, 1, 1), width=1920, height=1080) # Initialize soup3D
soup3D.light.ambient(1, 1, 1) # Set ambient light to maximum
surface = soup3D.shader.AutoSP(soup3D.shader.MixChannel((1, 1), 1, 0.5, 0)) # Create orange surface shader
face = soup3D.Face( # Create a right triangle
soup3D.TRIANGLE_L,
surface,
(
(0, 0, 0, 0, 0), # (x, y, z, u, v)
(1, 0, 0, 0, 0),
(0, 1, 0, 0, 0)
)
)
model = soup3D.Model(0, 0, -5, face) # Add triangle to model
model.show() # Display model
running = True # Running status
while running: # Main loop
soup3D.update() # Update soup3D
pygame.display.flip() # Refresh pygame screen
for event in pygame.event.get(): # Iterate through all events
if event.type == pygame.QUIT: # Detect window closing event
pygame.quit() # Close window
running = False # End loop
If the environment is properly configured, you will see an orange triangle in the window after running this code.
Contributing
Due to limited individual development capabilities, we welcome like-minded people to develop this project together. But for better code management, please first understand our development goals and code standards.
-
Development Goals
The purpose of developing this project is to create a 3D rendering engine that is easy to use while also having professional capabilities. We want Python developers to be able to develop 3D applications in a way that suits their habits.
-
Code Standards
Following these standards will increase the likelihood of your code being accepted:
-
All functions, classes, and class methods must have
reStructuredTextformat comments -
Test your code before submitting a PR. Please refer to the
Function Testingsection below for testing methods -
Confirm requirements with the author before developing any module
-
New features should not affect the calling methods of existing features
-
Do not import modules anywhere except at the beginning of files
-
Do not nest function definitions. All functions except class member functions must be defined in the global scope of their files
-
Class member variables can be accessed from outside the class, but do not modify them externally. If modification is needed, add class member functions instead
-
-
Function Testing
After development, you can test functionality in the following way:
-
Create a test environment with the following structure
-
Edit test code in
.../project/test.pyto test the functions you've written -
Run
.../project/test.py. If it runs successfully, the test is successful
-
More Information
This library has many more methods for you to use. For more information, please refer to the Help Document
License
This project is licensed under the MIT License, see the LICENSE file for details.
Release files for soup3D 6.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| soup3d-6.0.0.tar.gz | 101.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| soup3d-6.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 152.7 kB
Release files / soup3d-6.0.0.tar.gz
| Download URL | soup3d-6.0.0.tar.gz |
|---|---|
| Size | 101.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ce651a91eb3d20ccdb293f0f042c69e78a35900f9083896997144c8bd6a79692
|
|
BLAKE2b-256 checksum How to use checksums |
f3b308a7e0ac8790dcc962be9600a946590baf6d447dc0d2fdec9662f6c1d95b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.5
|
Release files / soup3d-6.0.0-py3-none-any.whl
| Download URL | soup3d-6.0.0-py3-none-any.whl |
|---|---|
| Size | 51.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e14c3cead838971da581fce5b2c8407693f1942e810584f1ecaaaebaa3043ba6
|
|
BLAKE2b-256 checksum How to use checksums |
b81a6f2ca12b8a2dd761024b22662df1a0a8fd8f6d789305ecc18a0ccc86ae32
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.5
|