Skip to main content

PopcornGL

A Python module based on my custom graphics engine.

This project is in open Alpha, and will improve depending on the attention it gets.

Requirements

Python versions tested: 3.9.6

Python modules needed:

  • operator
  • math
  • copy

How to Install

To install PopcornGL you need to run the command pip install popcorngl in your command prompt. If the command does not work, create an issue relating the problem and I'll see if I can help you.

Documentation

Classes

Camera(x_rotation, y_rotation, z_rotation, fov, center, distance)

This class is responsible for the camera in the scene.

Class Functions:
rotate_x(amount): rotates the camera a certain amount on the X axis around the center of the scene.
rotate_y(amount): rotates the camera a certain amount on the Y axis around the center of the scene.
rotate_z(amount): rotates the camera a certain amount on the Z axis around the center of the scene.
change_distance(amount): moves the camera further away from the object by a certain amount.

Class Variables:
x_rotation: the cameras rotation on the X axis.
y_rotation: the cameras rotation on the Y axis.
z_rotation: the cameras rotation on the Z axis.
fov: the cameras fov. (not actually the FOV I just didnt know what else to call it)
center: the center of the screen.
distance: the distance from the object in the scene.

Light(position, intensity, radius)

This class is responsible for the lighting in the scene. It's not necessary if you're not going to use it.

Class Variables:
position: The position of the light in the scene.
intensity: The intensity of the light.
radius: The range of the light.

Engine()

This class is responsible for functions that do math.

Class Functions:
do_3d_math(points, camera): This function returns the X and Y values of the points with 3D coords passed in it.
do_light_math(faces, points, light): This function returns the faces list with modification to the color based on the light.
sort_faces(faces): This function returns a sorted list of faces based on the depth of them in the scene (for painter's algorithm).

Release files for popcorngl 4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for popcorngl 4
File Size Uploaded
popcorngl-4.tar.gz 4.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for popcorngl 4
File Interpreter ABI Platform
popcorngl-4-py3-none-any.whl Python 3 none any Details

Total release size: 9.7 kB

Release files / popcorngl-4.tar.gz

Download URL popcorngl-4.tar.gz
Size 4.8 kB
Tags Source
SHA-256 checksum
How to use checksums
ceb60fe8d3f6ceae064c0b3151b7b753e7ad88f94bd1b2529973e5ccb90b5dfe
BLAKE2b-256 checksum
How to use checksums
50bfa0c057932696823092107453f6f9e4fa19be39db1228875f3f2c99063e5a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.8

Release files / popcorngl-4-py3-none-any.whl

Download URL popcorngl-4-py3-none-any.whl
Size 4.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
66206a5a2d26e3ea8ae15a3bbf07f84ba101fd4967f6a414e0fb8263dead87ef
BLAKE2b-256 checksum
How to use checksums
7c6adfca2122cab9037fb51f2becf812b5b769aaf49ccc32c35c68736677d927
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.8

Release history Release notifications | RSS feed

This release

4 This release

2 release files

3

2 release files

2

2 release files

1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page