Skip to main content

Pygame 3D

Pygame3D is a cross-platform open-source python library for basic 3D rendering in PyGame. It has many features, from 3D rendering to camera control. It is extremely simple, with a streamlined creation process, and just like what its name suggests, it integrates perfectly into PyGame.

Results


Scene rendering:

Installation


To install Pygame3D, use the Python Package Manager and type:

pip install pygame3d

Once it is installed, you can start using it just like any other module!

Documentation


To learn more about this module, you can read its documentation here

Quickstart


Here is a sample code to render a 3D model in Pygame3D, as shown in the image above.

# Basic model loading and rendering

import pygame
import pygame3d
import sys

# Initialize the pygame library
pygame.init()

screen = pygame.display.set_mode((800, 600))
clock = pygame.time.Clock()

# Create a 3D surface
surface = pygame3d.Surface3D((800, 600))

# Configure background color
surface.background_color = (145, 216, 255) # Sky blue

# Loading a model
model = surface.load_mesh('assets/model.glb')
model.position = (0, 20, -2)

# Add a light
light = surface.add_light('point')
light.position = (20, 20, 20)

light2 = surface.add_light('ambient')
light2.color = (50, 50, 50)

# Main game loop
while True:
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            pygame.quit()
            sys.exit()

    model.rotation += (1, 0, 0) # Rotate the model
    surface.render() # Render the surface to display the newest updates
    screen.blit(surface, (0, 0))

    pygame.display.update()
    clock.tick(60) # 60 FPS

Metadata

Release files for pygame3d 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pygame3d 0.1.1
File Size Uploaded
pygame3d-0.1.1.tar.gz 5.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pygame3d 0.1.1
File Interpreter ABI Platform
pygame3d-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 11.3 kB

Release files / pygame3d-0.1.1.tar.gz

Download URL pygame3d-0.1.1.tar.gz
Size 5.0 kB
Tags Source
SHA-256 checksum
How to use checksums
9fa504b03d093be296f85361d74d8d008f2e10ab95095fbcfa9149f83bb4b9b6
BLAKE2b-256 checksum
How to use checksums
e6c5184b248181c0051c72d6c40084202320106c7a765bd08b0fd509657bba47
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 7, 2025.

Transparency log

Release files / pygame3d-0.1.1-py3-none-any.whl

Download URL pygame3d-0.1.1-py3-none-any.whl
Size 6.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5130875060e106ac5014efd6c0e43e21a120f313e2d65fa04d92830aa2d7577e
BLAKE2b-256 checksum
How to use checksums
2a54e4ac1d51ad98bb78a079dae6695e48a57b667244e6fdb8d368e653025617
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 7, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page