Metadata-Version: 2.1
Name: three-py
Version: 0.0.1
Summary: A Python render engine like threejs
Home-page: https://github.com/panxinmiao/three-py
Author: Pan Xinmiao
Author-email: pan_xinmiao@163.com
License: MIT
Platform: UNKNOWN
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Scientific/Engineering :: Visualization
Requires-Python: >=3.7.0
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: wgpu (<0.8.0,>=0.7.7)

# 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](https://github.com/pygfx/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](./examples/).

```Python
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()
```



