Skip to main content

three-py

A Python render engine like threejs(via wgpu).

Introduction

This is a Python render engine build on top of WGPU.

Current status

Under development, many things can change.

Installation

pip install three-py

Requirements

wgpu-py

Usage

This code creates a scene, a camera, and a geometric cube, and animates the cube within the scene for the camera.

Also see the examples.

import three
from wgpu.gui.auto import WgpuCanvas, run

canvas = WgpuCanvas(size=(640, 480), title="wgpu_renderer")

render = three.WgpuRenderer(canvas, parameters={'antialias': True})
render.init()

camera = three.PerspectiveCamera(70, 640 / 480, 0.01, 100)
camera.position.z = 1

scene = three.Scene()

geometry = three.BoxGeometry(0.2, 0.2, 0.2)
material = three.MeshNormalMaterial()

mesh = three.Mesh(geometry, material)
scene.add(mesh)

def loop():
    mesh.rotation.x += 0.01
    mesh.rotation.y += 0.02
    render.render(scene, camera)

render.setAnimationLoop(loop)

run()

Metadata

Release files for three-py 0.0.2

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

Source distribution (sdist)

Source distribution for three-py 0.0.2
File Size Uploaded
three-py-0.0.2.tar.gz 136.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for three-py 0.0.2
File Interpreter ABI Platform
three_py-0.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 348.2 kB

Release files / three-py-0.0.2.tar.gz

Download URL three-py-0.0.2.tar.gz
Size 136.6 kB
Tags Source
SHA-256 checksum
How to use checksums
9482f2e545e4bf74a6d1c45712c2267dcf9a9589192af22dfa595c4f6a3aaefc
BLAKE2b-256 checksum
How to use checksums
5d8be92d2133c0eb6d6c00de94424f87ac79925d0a8b65a765ed374a4624d852
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.7.9

Release files / three_py-0.0.2-py3-none-any.whl

Download URL three_py-0.0.2-py3-none-any.whl
Size 211.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
873d085e99de0a4f2dfb7d2ccd8669475f1919e7604f07b4472a667bc6d7e7c5
BLAKE2b-256 checksum
How to use checksums
a183ae47491be097104bdbf6aa9db490e635bbc571cd1c25cc0ec92374f51f25
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.7.9

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files

0.0.1

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