No project description provided
Project description
PG3D
PG3D is a simple 3D graphics library written using Pygame.
Installation
- Install Python 3.7 or newer. https://www.python.org/downloads/
- Open cmd/terminal and type:
pip install pg3d
Dependencies
- python 3.7+
- pygame
Usage
- Import the library
from pg3d import *
- Create an App instance and call the run function
app = App()
#---Code goes here---#
#--------------------#
app.run()
API Reference
App(kwargs):
kwargs:
dimensions=(1000, 700)
cam_pos=[0, 0, 0]
BG_COLOR=None
LINE_COLOR=None
VERTEX_SIZE=2
fullscreen=False
mouse_look=False # Use mouse for camera orientation
functions:
run() # Draws all vertices and checks for movement
Model(args)
args:
app # Specify the App() object
path # Specify path of .obj file
Pyramid(args, kwargs)
args:
app # Specify the App() object
kwargs:
size=1
center=[0, 0, 0]
Cube(args, kwargs)
args:
app # Specify the App() object
kwargs:
size=1
center=[0, 0, 0]
Tetrahedron(args, kwargs)
args:
app # Specify the App() object
kwargs:
size=1
center=[0, 0, 0]
Triangle(args)
args:
app # Specify the App() object
vertices # List or tuple with 3 cartesian coordinates
functions:
__getitem__(index) # Returnes indext point of Triangle object
Point(args, kwargs)
args:
app # Specify the App() object
coordinate # A list with a single cartesian coordinate
kwargs:
vertex=True # If true the point is drawn and vice versa
functions:
__repr__() # Prints Point object
__setitem__(index, value) # Sets indexed coordinate of Point object to value
__getitem__(index) # Returns indexed coordinate of Point object
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pg3d-0.1.9.tar.gz
(12.0 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
pg3d-0.1.9-py3-none-any.whl
(14.7 kB
view details)
File details
Details for the file pg3d-0.1.9.tar.gz.
File metadata
- Download URL: pg3d-0.1.9.tar.gz
- Upload date:
- Size: 12.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6a85ff3099c3c1bdec5ab4e4a3c95ea57740d1db4a4ee02fb1c8c1f76aa5ab99
|
|
| MD5 |
06f7488be1680edb8b260b9052c4af64
|
|
| BLAKE2b-256 |
341247b28ec976e089bff13cae9566b97558a1c5d6cc3bcc75a9fca991d8d939
|
File details
Details for the file pg3d-0.1.9-py3-none-any.whl.
File metadata
- Download URL: pg3d-0.1.9-py3-none-any.whl
- Upload date:
- Size: 14.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
094333c506d5a54992006588257737ee574b71e7fc9c8dd596fea6e94ed876e2
|
|
| MD5 |
0b8a269f30c91899a22156315ab8e9c4
|
|
| BLAKE2b-256 |
712b6a21585ec196302f9f2abf9ee6e60b35a8ff2c025cb9c2f4abee6afab9f6
|