Metadata-Version: 2.4
Name: NSEV3D
Version: 0.4.3.1
Summary: A new, stable and efficient 3D game engine.
Author-email: 潘刀盾 <qw2026qw_2026@qq.com>
License-Expression: MIT
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Education
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Games/Entertainment
Classifier: Topic :: Multimedia :: Graphics :: 3D Rendering
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: vpython
Dynamic: license-file

# NSEV3D

A new, stable and efficient 3D game engine built on vpython.

## Installation

```bash
pip install NSEV3D
```

## Quick Start

```python
from NSEV3D import create_scene, Sphere, Box, Color, Camera

# Create scene (use fullscreen=True for borderless)
scene = create_scene(width=900, height=600, title="My Game")
scene.set_background(Color.rgb(0.1, 0.1, 0.15))

# Create 3D objects
ground = Box(size=(30, 0.2, 30), pos=(0, -1, 0), color=Color.rgb(0.2, 0.2, 0.2))
player = Sphere(radius=0.5, pos=(0, 0.5, 0), color=Color.red)

# Create camera (parent must be an Object3D)
# mode: "first_person" or "third_person"
# invert_x / invert_y: flip mouse axis
cam = Camera(player, scene.scene, mode="third_person", invert_x=False, invert_y=False)

# Toggle camera mode at runtime: cam.toggle_mode()

def update(dt):
    cam.update(dt)

scene.run(60, on_update=update)
```

## Controls

| Action | First-Person | Third-Person |
|--------|-------------|--------------|
| Move | W A S D | (follows parent) |
| Look | Mouse drag | Mouse drag |
| Toggle mode | `cam.toggle_mode()` | `cam.toggle_mode()` |

## API

### Scene
- `create_scene(width, height, title, fullscreen=False)`
- `set_background(color)`
- `set_title(title)`
- `set_size(width, height)`
- `run(FPS, on_update=None)`

### Colors (`Color`)
- Constants: `red`, `green`, `blue`, `yellow`, `orange`, `purple`, `cyan`, `magenta`, `white`, `black`, `gray`
- `Color.rgb(r, g, b)` — values 0.0–1.0
- `Color.rgb255(r, g, b)` — values 0–255

### 3D Objects (all inherit `Node`)
- `Sphere(radius, pos, color, opacity)`
- `Box(size, pos, color, opacity)`
- `Cylinder(radius, length, pos, axis, color, opacity)`
- `Cone(radius, length, pos, axis, color, opacity)`
- `Arrow(pos, axis, color, opacity)`
- Methods: `show()`, `hide()`, `add_child()`, `remove_child()`

### Camera
- `Camera(parent, scene, mode, invert_x, invert_y, sensitivity, move_speed, third_distance, third_height, crosshair)`
- `update(dt)` — call every frame
- `toggle_mode()` — switch first/third person
- `is_pressed(key)` — check if a key is held

### Node (scene graph)
- `Node(parent=None)`
- `add_child(child)`
- `remove_child(child)`
- `update(dt)`
