NSEV3D
A new, stable and efficient 3D game engine built on vpython.
Installation
pip install NSEV3D
Quick Start
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.0Color.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 frametoggle_mode()— switch first/third personis_pressed(key)— check if a key is held
Node (scene graph)
Node(parent=None)add_child(child)remove_child(child)update(dt)
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
nsev3d-0.4.2.1.tar.gz
(6.7 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nsev3d-0.4.2.1.tar.gz.
File metadata
- Download URL: nsev3d-0.4.2.1.tar.gz
- Upload date:
- Size: 6.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1590a11dda29a41fd91c5c8d17487df4bcb140fdb8d751bbce8d88355d554198
|
|
| MD5 |
ccba31ac286525567b9c69e53f7f6991
|
|
| BLAKE2b-256 |
1f27d07533997818413cb602c6f34af6510fdf877b9a4f6bbf4abcb931931660
|
File details
Details for the file nsev3d-0.4.2.1-py3-none-any.whl.
File metadata
- Download URL: nsev3d-0.4.2.1-py3-none-any.whl
- Upload date:
- Size: 8.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
068bc7d0dcdaeddb48801afdac7f32a4d462070c11e895fcbe1f8e1c99274538
|
|
| MD5 |
a27b546b81d9e1d84b544506a40169ef
|
|
| BLAKE2b-256 |
224777425863b3fa4e63a585f4d94bbb1093e3e58616b18598201532017b1289
|