This first ever python library that can function as a simple 3D engine for the usage of displaying and rotating of Objects. This library allows for you to use any library in addition to this one and display whatever object any way that you want. The purpose of this library is allow the user to quickly and efficiently display 3D objects without the use of complex libraries. This library is still in its alpha stages and is being rapidly updated/altered with new features, improved efficiency, less bugs and more stability.
Installation
pip install Lobster
Dependencies
python (built-in) math library :: sin, cos, tan, sqrt, pi
Usage
IMPORTING
from Lobster import Object, Camera, init, display
Displaying a Rotating Cube using the Pygame Library
from Lobster import Object, Camera, init, display
import pygame
pygame.init()
clock = pygame.time.Clock()
screen_width, screen_height = 600, 600
displayScreen = True
screen = pygame.display.set_mode((screen_width, screen_height))
init(screen_width, screen_height, 3.141592653 / 2, 0.1, 50)
cube = Object(
vertices=((1, 1, 1), (1, 1, -1), (1, -1, 1), (1, -1, -1),
(-1, 1, 1), (-1, 1, -1), (-1, -1, 1), (-1, -1, -1)),
position=[0, 0, 5],
faces=((0, 4, 6, 2), (3, 2, 6, 7), (7, 6, 4, 5), (5, 1, 3, 7), (1, 0, 2, 3), (5, 4, 0, 1)),
colors=((255, 0, 255), (255, 0, 0), (100, 150, 1), (233, 223, 15), (13, 150, 225), (13, 223, 125))
)
player = Camera(position=[0, 0, 0], rotation=[0, 0, 0])
while displayScreen:
for event in pygame.event.get():
if event.type == pygame.QUIT:
displayScreen = False
screen.fill((255, 255, 255))
player.rotation[0] += 0.03
player.rotation[1] += 0.01
player.rotation[2] += 0.02
for (points, z_len, color) in display(cube, player):
pygame.draw.polygon(screen, color, points)
pygame.display.set_caption(str(clock.get_fps()))
clock.tick(60)
pygame.display.update()
Uninstallation
pip uninstall Lobster
Release files for Lobster-3dEngine 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| Lobster-3dEngine-0.0.1.tar.gz | 3.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| Lobster_3dEngine-0.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 8.1 kB
Release files / Lobster-3dEngine-0.0.1.tar.gz
| Download URL | Lobster-3dEngine-0.0.1.tar.gz |
|---|---|
| Size | 3.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
79b8daabb979053b713ab57a86506759591264fc721c6083779b12f0bb1dbef6
|
|
BLAKE2b-256 checksum How to use checksums |
db43a8a5d724ff807cc35d015920f33493aa4ce60b53d0a344d7a81254598f39
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.5
|
Release files / Lobster_3dEngine-0.0.1-py3-none-any.whl
| Download URL | Lobster_3dEngine-0.0.1-py3-none-any.whl |
|---|---|
| Size | 4.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fecd80adb226aa063d7f592ea17a471d0388000de024eb2d1a2a784051adec19
|
|
BLAKE2b-256 checksum How to use checksums |
240208bad010f05418bc9b06ac86332c350bd9fa17de0a9a53752bebd646bd02
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.5
|