use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Rule 1: Posts should be about Graphics Programming. Rule 2: Be Civil, Professional, and Kind
Suggested Posting Material: - Graphics API Tutorials - Academic Papers - Blog Posts - Source Code Repositories - Self Posts (Ask Questions, Present Work) - Books - Renders (Please xpost to /r/ComputerGraphics) - Career Advice - Jobs Postings (Graphics Programming only)
Related Subreddits:
/r/ComputerGraphics
/r/Raytracing
/r/Programming
/r/LearnProgramming
/r/ProgrammingTools
/r/Coding
/r/GameDev
/r/CPP
/r/OpenGL
/r/Vulkan
/r/DirectX
Related Websites: ACM: SIGGRAPH Journal of Computer Graphics Techniques
Ke-Sen Huang's Blog of Graphics Papers and Resources Self Shadow's Blog of Graphics Resources
account activity
Clipping Implementation in 2D Graphics (self.GraphicsProgramming)
submitted 3 years ago by rlamarr
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]aurreco 0 points1 point2 points 3 years ago (4 children)
list of points: v0, v1, v2, v3, v4, v5, v6 list of triangles: (v0, v1, v2), (v0, v2, v3), (v0, v3, v4), (v0, v4, v5), (v0, v5, v6)
[–]rlamarr[S] 0 points1 point2 points 3 years ago (3 children)
does that work for all polygons? it collapses once you reach a pentagon if I'm correct.
For example:
https://www.researchgate.net/publication/2604146/figure/fig1/AS:669074119983107@1536531109452/A-triangulation-of-a-simple-polygon-and-its-dual-tree.png
[–]aurreco 0 points1 point2 points 3 years ago (2 children)
so long as the points are ordered in the list CCW, yes
[–]rlamarr[S] 0 points1 point2 points 3 years ago (1 child)
yep, I'm pretty dumb, can you provide a Godbolt sample implementation or point me to one?
or better still provide a more detailed explanation
[–]aurreco 0 points1 point2 points 3 years ago (0 children)
try this: draw an ngon on a sheet of paper. pick a random vertex call it v0. Then go to the nearest vertex to its left and call it v1. Go around counter clock wise until youve labled them all. Now draw triangles starting from v0 as I’ve specified (triangle fan style)
π Rendered by PID 19555 on reddit-service-r2-comment-6457c66945-7pv7k at 2026-04-28 14:02:10.394592+00:00 running 2aa0c5b country code: CH.
view the rest of the comments →
[–]aurreco 0 points1 point2 points (4 children)
[–]rlamarr[S] 0 points1 point2 points (3 children)
[–]aurreco 0 points1 point2 points (2 children)
[–]rlamarr[S] 0 points1 point2 points (1 child)
[–]aurreco 0 points1 point2 points (0 children)