{"id":15054405,"url":"https://github.com/sinanislekdemir/payton","last_synced_at":"2025-08-15T19:18:22.190Z","repository":{"id":34993657,"uuid":"176040262","full_name":"sinanislekdemir/payton","owner":"sinanislekdemir","description":"Payton! Kickstart any 3D OpenGL + GTK Ideas in a few seconds!","archived":false,"fork":false,"pushed_at":"2025-04-19T13:54:22.000Z","size":34369,"stargazers_count":49,"open_issues_count":0,"forks_count":7,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-07-20T21:39:44.182Z","etag":null,"topics":["3d","3d-graphics","game","graphics","graphics-programming","gtk3","kickstart","library","opengl","python","scientific-computing","scientific-visualization","sdl2","toolkit"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sinanislekdemir.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-03-17T00:43:24.000Z","updated_at":"2025-04-19T13:54:25.000Z","dependencies_parsed_at":"2023-12-15T21:17:36.231Z","dependency_job_id":"6e1e852d-f0a4-44ff-8bc6-aeeb66fc0e8b","html_url":"https://github.com/sinanislekdemir/payton","commit_stats":{"total_commits":306,"total_committers":6,"mean_commits":51.0,"dds":0.08823529411764708,"last_synced_commit":"15712a80cfa9478cf94b572d0a981c726a7d7023"},"previous_names":[],"tags_count":50,"template":false,"template_full_name":null,"purl":"pkg:github/sinanislekdemir/payton","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sinanislekdemir%2Fpayton","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sinanislekdemir%2Fpayton/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sinanislekdemir%2Fpayton/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sinanislekdemir%2Fpayton/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sinanislekdemir","download_url":"https://codeload.github.com/sinanislekdemir/payton/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sinanislekdemir%2Fpayton/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270617840,"owners_count":24617123,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-15T02:00:12.559Z","response_time":110,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["3d","3d-graphics","game","graphics","graphics-programming","gtk3","kickstart","library","opengl","python","scientific-computing","scientific-visualization","sdl2","toolkit"],"created_at":"2024-09-24T21:38:44.157Z","updated_at":"2025-08-15T19:18:22.145Z","avatar_url":"https://github.com/sinanislekdemir.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Payton 3D SDK\n[Payton 3D SDK Screencast](https://github.com/sinanislekdemir/payton/assets/1842484/a18c8e43-61e9-48c3-a92a-4988716a1919)\n\n![example workflow](https://github.com/sinanislekdemir/payton/actions/workflows/pythonpackage.yml/badge.svg)\n[![Downloads](https://pepy.tech/badge/payton/month)](https://pepy.tech/project/payton)\n[![Downloads](https://pepy.tech/badge/payton/week)](https://pepy.tech/project/payton)\n\nPayton is a 3D Software Development Kit that serves as a general-purpose playground for programming. With Payton, users can quickly and easily kickstart their ideas and create tools for the next step, such as map editors, small animations, small algorithms, or artificial intelligence for games. Unlike game engines and other libraries that can be too complex and time-consuming to start, Payton comes with pre-set defaults, making it unique and simple to use.\n\nPayton is not intended to be a game engine or a full-featured 3D environment as there are already plenty of tools available for those purposes. However, it excels at tools programming and allows users to easily visualize their goals and achieve them. Users can also move forward from Payton to any other place if they desire.\n\nWhile 2D graphs and charts are useful in reports, some cases require visualizing data in 3 or 4 dimensions. Payton enables users to extend their graphics into 4 dimensions and read real-time data from sensors, cameras, or any other data source. These sources can be anything that generates time-based 3D data, including thermometers, random number generators, toy cars connected to speed sensors, maps, or vehicle ports. Payton can even handle time-based formulas. Although it can get complex, Payton is designed to be easy to use, even for beginners who can follow the tutorials to kick-start their programming skills.\n\n## Contents of this Document:\n\n- [Payton 3D SDK](#payton-3d-sdk)\n  - [Contents of this Document:](#contents-of-this-document)\n  - [Features:](#features)\n  - [Install](#install)\n    - [Requirements:](#requirements)\n    - [Install using Pip:](#install-using-pip)\n      - [AWP3D Format and Exporter](#awp3d-format-and-exporter)\n      - [Using Payton with Anaconda](#using-payton-with-anaconda)\n    - [Upgrade to the latest version:](#upgrade-to-the-latest-version)\n  - [Getting Started](#getting-started)\n    - [Your first code](#your-first-code)\n  - [Controls](#controls)\n  - [Examples](#examples)\n  - [Example Index](#example-index)\n  - [Contribution](#contribution)\n  - [Screenshots and Videos](#screenshots-and-videos)\n  - [Troubleshooting](#troubleshooting)\n  - [Some free-thoughts and decisions:](#some-free-thoughts-and-decisions)\n\n\n## Features:\n\n-   3D Math Library\n-   Various base geometries:\n    -   Cube\n    -   Cylinder\n    -   Triangular Mesh\n    -   Plane\n    -   Lines\n    -   Particle System\n    -   Sphere\n    -   Dynamic Grid\n-   Clean default scene\n-   Pre-defined keyboard-mouse and camera controls\n-   Pre-defined environment\n-   Clock system for parallel tasks and time-based operations\n-   Simple collision detection\n-   Optional Physics Engine\n    -   Basic support for Bullet Physics (to be extended)\n-   Extendable controllers\n-   Pre-defined lighting with shadows\n-   Material support\n-   Clickable objects and virtual planes\n-   Shader support\n-   Basic GUI Support\n    -   Window\n    -   Panel\n    -   Button\n    -   EditBox (with multi-line support)\n-   3D File formats:\n    -   AWP3D Animated High-Poly 3D Object\n    -   Wavefront OBJ\n    -   Quake 2 MD2 with Animations\n-   Mesh Generation Tools\n    -   Extrude Line in 3D\n    -   Rotate Line around an axis in 3D\n    -   Fill between lines\n-   Mesh modifiers:\n    -   Merge Mesh\n    -   Subdivide Mesh\n-   Extensive examples for every feature\n\n## Install\n\n### Requirements:\n\n- LibSDL2 `sudo apt install libsdl2-dev` for debian/ubuntu based linux distros. For other platforms, you can see your favourite package manager.\n- imagemagick `sudo apt install imagemagick` for debian/ubuntu based linux distros. For other platforms, you can see your favourite package manager.\n- Python 3.10+\n- A Graphics card that supports OpenGL 3.3+\n\n### Install using Pip:\n\nFrom a bash terminal:\n```bash\npip install payton\n```\n\nThis should install all dependencies. If you get any permission errors, you are probably installing the library to system-global so missing some permissions. If you do not want to use pipenv or virtualenv, then you might want to run above command as `sudo pip3 install payton`\n\n### Optional Bullet Physics Integration\n\nPayton supports Bullet Physics at a basic level for solid geometries.\n\n```bash\npip install pybullet\n```\n\nOnce Bullet Physics is successfully installed in the same environment as Payton, it will be automatically activated and you will be able to use its basic properties.\nCheck out the relevant examples.\n\n### Optional GTK3 Integration\n\nInstead of SDL2, you can use GTK3 (along with all nice GTK3 widgets) with Payton.\n![https://raw.githubusercontent.com/sinanislekdemir/payton/assets/assets/gtk3.jpg](https://raw.githubusercontent.com/sinanislekdemir/payton/assets/assets/gtk3.png)\n\nYou need to [install Python GTK3 Bindings](https://pygobject.readthedocs.io/en/latest/getting_started.html).\n\n#### AWP3D Format and Exporter\n\nAWP3D is simply a ZIP file containing every frame as a Wavefront object. To export your animated Blender objects as AWP3D files, you can use the exporter add-on available here:\n\n[https://github.com/sinanislekdemir/payton/tree/master/plugins](https://github.com/sinanislekdemir/payton/tree/master/plugins)\n\n#### Using Payton with Anaconda\n\nAs of version `0.0.10`, Payton is installable on Anaconda. From Anaconda Prompt:\n\n```bash\npip install payton\n```\n\nIs sufficient to install Payton and it's dependencies on Anaconda.\n\nPayton will be available to use with Spyder or JupyterLab on local.\n\n![](https://islekdemir.com/payton/anaconda.png)\n\n### Upgrade to the latest version:\n\nPayton is under active maintenance. This means I am spending some time to fix the bugs or make it better. So you might want to upgrade it occasionally.\n\n    pip3 install payton --upgrade\n    \nshould do the trick!\n\n## Getting Started\n\n### Your first code\n\n```python\nfrom payton.scene import Scene\n\nscene = Scene()\nscene.run()\n```\n\nThis will create your first empty scene and show it inside an SDL window.\n\n## Controls\n\n| Key / Action | Description |\n| --- | --- |\n| Mouse Wheel | Zoom In - Zoom Out|\n| Right Mouse Button Drag | Rotate Scene |\n| Middle Mouse Button Drag | Pan Scene |\n| Escape | Quit Simulation |\n| C | Change Camera Mode (Perspective / Orthographic) |\n| Space | UnPause / Pause Scene Clocks |\n| G | Show / Hide Grid |\n| W | Change Display Mode (Solid / Wireframe / Points) |\n| F2 | Previous Camera |\n| F3 | Next Camera |\n| H | Open / Close Help Window |\n\n## Environment variables\n\nSome options can be configured from the environment variables.\n\n- `SDL_WINDOW_WIDTH`: Set window width.\n- `SDL_WINDOW_HEIGHT`: Set window height.\n- `GL_MULTISAMPLEBUFFERES`: Set OpenGL multisample buffer count for antialiasing. (usually 1 or 2)\n- `GL_MULTISAMPLESAMPLES`: Set OpenGL multisample sampling count for antialiasing. (usually 1-16)\n\nWithout `GL_MULTISAMPLEBUFFERS` AND `GL_MULTISAMPLESAMPLES`, you may notice pixelated graphics. There is no default set for those values because they can vary between graphic cards.\n\n## Troubleshooting\n\nIn some older systems or where a decent graphics driver is not installed, you can try running Payton code with MESA. It runs fine. There will be some performance decrease. But it will not be noticeable for basic applications.\n\nTo enforce MESA 3.3, you can run payton with:\n\n```\nMESA_GL_VERSION_OVERRIDE=3.3 python \u003cpath-to-your-payton-code\u003e\n```\n\n## Examples\n\nPersonally, I don’t really read the long descriptive documentation unless necessary. I like things simple and self-explaining. Therefore, instead of writing long documentations, I write simple examples to use each feature of Payton without digging much into the internals.\n\nExamples can be downloaded from [Payton Github Page](https://github.com/sinanislekdemir/payton/tree/master/examples).\n\nYou can either download the whole repository [as a zip file](https://github.com/sinanislekdemir/payton/archive/master.zip) or you can just `git clone` it.\n\n*Tested in Windows 10 Paperspace, seems to be working as expected*\n![https://user-images.githubusercontent.com/1842484/84317888-38767780-ab76-11ea-8337-a102d7c59275.png](https://user-images.githubusercontent.com/1842484/84317888-38767780-ab76-11ea-8337-a102d7c59275.png)\n\n*Supports pyBullet solid geometry physics*\n[![https://www.youtube.com/watch?v=Zt2vnUMLYVs](https://www.islekdemir.com/snapshot.jpg)](https://www.youtube.com/watch?v=Zt2vnUMLYVs)\n\n## Example Index\n\n* Basic Examples\n  * [Scene](https://github.com/sinanislekdemir/payton/blob/master/examples/basics/01_scene.py)\n  * Objects\n    * [Adding a cube](https://github.com/sinanislekdemir/payton/blob/master/examples/basics/02_cube.py)\n    * [Adding multiple cubes](https://github.com/sinanislekdemir/payton/blob/master/examples/basics/03_cubes.py)\n    * [Object parent-child relations](https://github.com/sinanislekdemir/payton/blob/master/examples/basics/05_children.py)\n    * [Cylinder object](https://github.com/sinanislekdemir/payton/blob/master/examples/basics/18_cylinder.py)\n    * [How to load complex triangular objects](https://github.com/sinanislekdemir/payton/blob/master/examples/basics/06_monkey.py)\n    * [Complex meshes](https://github.com/sinanislekdemir/payton/blob/master/examples/basics/09_mesh.py)\n    * [Point cloud](https://github.com/sinanislekdemir/payton/blob/master/examples/basics/11_point_cloud.py)\n    * [Particle System](https://github.com/sinanislekdemir/payton/blob/master/examples/basics/11_particle_system.py)\n    * [Plane Object](https://github.com/sinanislekdemir/payton/blob/master/examples/basics/13_plane.py)\n    * [Line object](https://github.com/sinanislekdemir/payton/blob/master/examples/basics/17_line.py)\n    * [Better Lines Example](https://github.com/sinanislekdemir/payton/blob/master/examples/basics/33_better_lines.py)\n    * [Mesh plane](https://github.com/sinanislekdemir/payton/blob/master/examples/basics/32_mesh_plane.py)\n    * [Quake 2 Objects](https://github.com/sinanislekdemir/payton/blob/master/examples/basics/26_quake2.py)\n    * [Ragdoll Object](https://github.com/sinanislekdemir/payton/blob/master/examples/basics/28_ragdoll.py)\n  * [How to use \"clock\"](https://github.com/sinanislekdemir/payton/blob/master/examples/basics/04_clock.py)\n  * [Object picking using mouse](https://github.com/sinanislekdemir/payton/blob/master/examples/basics/07_picking.py)\n  * [Load textures](https://github.com/sinanislekdemir/payton/blob/master/examples/basics/08_texture.py)\n  * [Vertex colors](https://github.com/sinanislekdemir/payton/blob/master/examples/basics/10_vertex_colors.py)\n  * Collision Detection\n    * [Simple example](https://github.com/sinanislekdemir/payton/blob/master/examples/basics/12_collision.py)\n    * [Complex example](https://github.com/sinanislekdemir/payton/blob/master/examples/basics/12_1_collision_detailed.py)\n  * Physics Engine\n    * [Cubes example](https://github.com/sinanislekdemir/payton/blob/master/examples/additional/01_bullet_hello.py)\n    * [Joint example](https://github.com/sinanislekdemir/payton/blob/master/examples/additional/02_joint_p2p.py)\n  * [GTK3 Python OpenGL Payton Integration](https://github.com/sinanislekdemir/payton/blob/master/examples/additional/03_gtk.py)\n  * [Rotating Objects](https://github.com/sinanislekdemir/payton/blob/master/examples/basics/14_rotate.py)\n  * [Graphical User Interface (GUI)](https://github.com/sinanislekdemir/payton/blob/master/examples/basics/15_gui.py)\n  * [Custom keyboard shortcuts](https://github.com/sinanislekdemir/payton/blob/master/examples/basics/16_keyboard.py)\n  * [Using multiple cameras](https://github.com/sinanislekdemir/payton/blob/master/examples/basics/19_multiple_cameras.py)\n  * [Changing background](https://github.com/sinanislekdemir/payton/blob/master/examples/basics/20_background.py)\n  * [Click plane (get cursor location in world coordinates)](https://github.com/sinanislekdemir/payton/blob/master/examples/basics/21_click_plane.py)\n  * [Using object motion history](https://github.com/sinanislekdemir/payton/blob/master/examples/basics/22_go_back.py)\n  * [Object Oriented Approach](https://github.com/sinanislekdemir/payton/blob/master/examples/basics/24_object_oriented.py)\n  * [Materials](https://github.com/sinanislekdemir/payton/blob/master/examples/basics/25_materials.py)\n  * [Exporting and importing your scene to json](https://github.com/sinanislekdemir/payton/blob/master/examples/basics/27_json.py)\n  * [Changing time of day](https://github.com/sinanislekdemir/payton/blob/master/examples/basics/29_day.py)\n  * [Near and Far Planes](https://github.com/sinanislekdemir/payton/blob/master/examples/basics/30_near_far_plane.py)\n  * [Spotlight Example](https://github.com/sinanislekdemir/payton/blob/master/examples/basics/31_spotlight.py)\n  * [Mesh Plane Example](https://github.com/sinanislekdemir/payton/blob/master/examples/basics/32_mesh_playne.py)\n  * [AWP3D Example](https://github.com/sinanislekdemir/payton/blob/master/examples/basics/34_awp3d.py)\n  * [AWP3D Example Ranges](https://github.com/sinanislekdemir/payton/blob/master/examples/basics/35_awp3d_range.py)\n* Mid Level\n  * [Popping the baloons game](https://github.com/sinanislekdemir/payton/blob/master/examples/mid-level/balloon.py)\n  * [Build mesh using heightmap](https://github.com/sinanislekdemir/payton/blob/master/examples/mid-level/engrave.py)\n  * [Fetch Instagram Images and build 3D Wall](https://github.com/sinanislekdemir/payton/blob/master/examples/mid-level/instagram.py)\n  * [A bit more complex Quake Example](https://github.com/sinanislekdemir/payton/blob/master/examples/mid-level/quake2.py)\n  * [Ripple Example (Mesh Grid)](https://github.com/sinanislekdemir/payton/blob/master/examples/mid-level/ripple.py)\n  * [RPG-like Controls](https://github.com/sinanislekdemir/payton/blob/master/examples/mid-level/rpg.py)\n  * [Custom Shader](https://github.com/sinanislekdemir/payton/blob/master/examples/mid-level/shader.py)\n* High Level\n  * Multiplayer\n    * [Server backend for a multiplayer game](https://github.com/sinanislekdemir/payton/blob/master/examples/high-level/multiplayer/server.py)\n    * [3D Blocks building game multiplayer](https://github.com/sinanislekdemir/payton/blob/master/examples/high-level/multiplayer/client3D.py)\n\n## Contribution\n\n* Please keep using type hints in the main library.\n* Type hinting can be ignored for examples.\n* Example codes should be plain and simple.\n* Every new features should include sensible defaults.\n  * Nothing should be too verbose to use.\n* Make sure that `make check` is clear before pushing your code.\n* Running `isort .` is not mandatory but highly encouraged.\n* Ever new feature should have an example code.\n* There is a reason why some methods are longer than they should and complex.\n  * To reduce code jumps and stack switches.\n  * To run faster.\n\n## Screenshots and Videos\n\n[![](https://islekdemir.com/payton/youtube.png)](https://www.youtube.com/watch?v=bKQ9G1J5JYM)\n\n[![](http://i3.ytimg.com/vi/3ATRVLNuCew/maxresdefault.jpg)](https://www.youtube.com/watch?v=3ATRVLNuCew)\n\n## Examples Showcase:\n\n![https://github.com/sinanislekdemir/payton/blob/assets/assets/02.jpg?raw=true](https://github.com/sinanislekdemir/payton/blob/assets/assets/02.jpg?raw=true)\n![https://github.com/sinanislekdemir/payton/blob/assets/assets/04.jpg?raw=true](https://github.com/sinanislekdemir/payton/blob/assets/assets/04.jpg?raw=true)\n![https://github.com/sinanislekdemir/payton/blob/assets/assets/05.jpg?raw=true](https://github.com/sinanislekdemir/payton/blob/assets/assets/05.jpg?raw=true)\n![https://github.com/sinanislekdemir/payton/blob/assets/assets/11.jpg?raw=true](https://github.com/sinanislekdemir/payton/blob/assets/assets/11.jpg?raw=true)\n![https://github.com/sinanislekdemir/payton/blob/assets/assets/awp3d.jpg?raw=true](https://github.com/sinanislekdemir/payton/blob/assets/assets/awp3d.jpg?raw=true)\n![https://github.com/sinanislekdemir/payton/blob/assets/assets/bullet.jpg?raw=true](https://github.com/sinanislekdemir/payton/blob/assets/assets/bullet.jpg?raw=true)\n![https://github.com/sinanislekdemir/payton/blob/assets/assets/day.jpg?raw=true](https://github.com/sinanislekdemir/payton/blob/assets/assets/day.jpg?raw=true)\n![https://github.com/sinanislekdemir/payton/blob/assets/assets/engrave.jpg?raw=true](https://github.com/sinanislekdemir/payton/blob/assets/assets/engrave.jpg?raw=true)\n![https://github.com/sinanislekdemir/payton/blob/assets/assets/explosion.jpg?raw=true](https://github.com/sinanislekdemir/payton/blob/assets/assets/explosion.jpg?raw=true)\n![https://github.com/sinanislekdemir/payton/blob/assets/assets/gui.jpg?raw=true](https://github.com/sinanislekdemir/payton/blob/assets/assets/gui.jpg?raw=true)\n![https://github.com/sinanislekdemir/payton/blob/assets/assets/quake.jpg?raw=true](https://github.com/sinanislekdemir/payton/blob/assets/assets/quake.jpg?raw=true)\n![https://github.com/sinanislekdemir/payton/blob/assets/assets/ripple.jpg?raw=true](https://github.com/sinanislekdemir/payton/blob/assets/assets/ripple.jpg?raw=true)\n![https://github.com/sinanislekdemir/payton/blob/assets/assets/spot.jpg?raw=true](https://github.com/sinanislekdemir/payton/blob/assets/assets/spot.jpg?raw=true)\n\n## Some free-thoughts and decisions:\n\nI've choosen to use `List[float]` type for Vectors because:\n\n* I needed something mutable. Otherwise, the number of memory copy and swaps would be too much. So, I've crossed out `Tuple` and `NamedTuple`.\n* `dataclass` has an overhead to convert to C-type floats and arrays in memory.\n\nSo, to gain some performance, I have created the main library with a risk of non-strict vector lengths.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsinanislekdemir%2Fpayton","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsinanislekdemir%2Fpayton","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsinanislekdemir%2Fpayton/lists"}