{"id":15762455,"url":"https://github.com/williamvenner/gmod-3d2d-clipping","last_synced_at":"2025-11-06T19:03:50.158Z","repository":{"id":109206185,"uuid":"325652162","full_name":"WilliamVenner/gmod-3d2d-clipping","owner":"WilliamVenner","description":" ✂️ Simple library for efficient and cross-platform clipping of 3D2D GUI in Garry's Mod","archived":false,"fork":false,"pushed_at":"2020-12-31T18:52:22.000Z","size":4,"stargazers_count":22,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-11T11:35:29.472Z","etag":null,"topics":["3d2d","clip","clipping","gmod","lua","scissor","scissoring","stencil","stencils"],"latest_commit_sha":null,"homepage":"","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/WilliamVenner.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"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}},"created_at":"2020-12-30T21:32:52.000Z","updated_at":"2024-01-29T11:03:06.000Z","dependencies_parsed_at":null,"dependency_job_id":"f97dbaaa-84b2-4750-9bb2-185e3af17fa1","html_url":"https://github.com/WilliamVenner/gmod-3d2d-clipping","commit_stats":{"total_commits":4,"total_committers":1,"mean_commits":4.0,"dds":0.0,"last_synced_commit":"3fe08d9a57613e6d75f6d5371d2087ff9c76fbfe"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WilliamVenner%2Fgmod-3d2d-clipping","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WilliamVenner%2Fgmod-3d2d-clipping/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WilliamVenner%2Fgmod-3d2d-clipping/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WilliamVenner%2Fgmod-3d2d-clipping/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WilliamVenner","download_url":"https://codeload.github.com/WilliamVenner/gmod-3d2d-clipping/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246604612,"owners_count":20804100,"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","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":["3d2d","clip","clipping","gmod","lua","scissor","scissoring","stencil","stencils"],"created_at":"2024-10-04T11:09:17.046Z","updated_at":"2025-11-06T19:03:45.112Z","avatar_url":"https://github.com/WilliamVenner.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"## 3d2d-clipping\n\n✂️ Simple library for efficient and cross-platform clipping of 3D2D GUI in Garry's Mod\n\n## Example\n\n\u003cp align=\"center\"\u003e\n    \u003cimg alt=\"Example\" src=\"https://i.imgur.com/1L73wtQ.gif\"/\u003e\n    \u003cbr/\u003e\u003cbr/\u003e\n    \u003cb\u003eLeft:\u003c/b\u003e No clipping\n    \u003cbr/\u003e\n    \u003cb\u003eRight:\u003c/b\u003e 2D clipped\n\u003c/p\u003e\n\n## Usage\n\n### Loading the Library\n```lua\nmy_addon.clip = include(\"lib/clip.lua\")\n```\n\n### Clipping 2D Rectangles\n```lua\nlocal width, height = 200, 400\ncam.Start3D2D(pos, ang, scale)\n    my_addon.clip:Scissor2D(width, height)\n        -- Draw 2D clipped stuff here!\n    my_addon.clip()\ncam.End3D2D()\n```\n\n### Clipping 3D Bounding Boxes\n\n```lua\nlocal mins, maxs = ent:OBBMins(), ent:OBBMaxs()\n-- or\nlocal mins, maxs = ent:GetModelBounds()\n\nmy_addon.clip:Scissor3D(pos, ang, mins, maxs)\n    cam.Start3D2D(pos, ang, scale)\n        -- Draw 3D clipped stuff here!\n    cam.End3D2D()\nmy_addon.clip()\n```\n\n\u003cp align=\"center\"\u003e\n    \u003ci\u003eIn most cases, this is \u003cb\u003enot recommended\u003c/b\u003e because stencils are fundamentally 2D, leading to depth issues like this:\u003c/i\u003e\u003cbr/\u003e\u003cbr/\u003e\n    \u003cimg alt=\"Depth Problems Example\" src=\"https://i.imgur.com/e0U8Kow.gif/\"\u003e\n\u003c/p\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwilliamvenner%2Fgmod-3d2d-clipping","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwilliamvenner%2Fgmod-3d2d-clipping","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwilliamvenner%2Fgmod-3d2d-clipping/lists"}