Skip to main content

No project description provided

Project description

PG3D

PG3D is a simple 3D graphics library written using Pygame.

Installation


  1. Install Python 3.7 or newer. https://www.python.org/downloads/
  2. Open cmd/terminal and type:
pip install pg3d

Dependencies


  • python 3.7+
  • pygame

Usage


  1. Import the library
from pg3d import *
  1. 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


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.8.tar.gz (11.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pg3d-0.1.8-py3-none-any.whl (14.7 kB view details)

Uploaded Python 3

File details

Details for the file pg3d-0.1.8.tar.gz.

File metadata

  • Download URL: pg3d-0.1.8.tar.gz
  • Upload date:
  • Size: 11.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.10

File hashes

Hashes for pg3d-0.1.8.tar.gz
Algorithm Hash digest
SHA256 b79abd01dd36f72bd954f7b307d92b281d571cc4d67e415628d8b66c510ec1df
MD5 80f0b7af54412b28f4ce7f619ea69ec6
BLAKE2b-256 bfe44f8b1d28bc26cfd1bbb7d36dc176ab182b7dae04e71a5e9fe6f348ab1e35

See more details on using hashes here.

File details

Details for the file pg3d-0.1.8-py3-none-any.whl.

File metadata

  • Download URL: pg3d-0.1.8-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

Hashes for pg3d-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 a02b4f22ba4ab35e8b2858cbf7860654661c2e8ca052d0c0cb79ab18fd0a1157
MD5 5f91a14bb09061cf4564ff8a73b5bb64
BLAKE2b-256 9ac1c02bbc79967232eb012c383f9488b22d1accb593647fce6fa50e086ee81b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page