Team Spartan Cookies & Milk Forums
  • Issue Tracker
  • Donations
  • Search
  • Member List
  • Help

Register

Team Spartan Cookies & Milk Forums Garry's Mod Starfall v
« Previous 1 2 3 4 5 … 18 Next »
render.drawPoly() issue with concave polygons
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Linear Mode
render.drawPoly() issue with concave polygons
15-05-2021, 02:52 PM,
#4
Veegi Offline
Marker Translator
Posts: 90
Threads: 6
Joined: Sep 2013
RE: render.drawPoly() issue with concave polygons
The built-in function does not support concave polys, as it uses a triangle fan method to render the polygon. In some cases it might work by coincidence.
If it was simple (performance wise) to implement an algorithm to split concave polys into multiple convex polys, we would already be using that.
What could be worth it would be to implement an algorithm that can split arbitrary concave polygons into convex polygons and then use that as a preprocessing step (only once, outside of rendering hooks), feeding the convex polygons to DrawPoly.

Link to the GLua function if you are curious: https://wiki.facepunch.com/gmod/surface.DrawPoly
Polygon triangulation in general: https://en.wikipedia.org/wiki/Polygon_triangulation
Triangle fan triangulation: https://en.wikipedia.org/wiki/Fan_triangulation (It works on a small subset of concave polygons, and is what DrawPoly uses)

ohai
Find
Reply
« Next Oldest | Next Newest »


Messages In This Thread
render.drawPoly() issue with concave polygons - by The17thDoctor - 14-05-2021, 10:45 PM
RE: render.drawPoly() issue with concave polygons - by 57e11a - 15-05-2021, 03:53 AM
RE: render.drawPoly() issue with concave polygons - by The17thDoctor - 15-05-2021, 09:53 AM
RE: render.drawPoly() issue with concave polygons - by Veegi - 15-05-2021, 02:52 PM

  • View a Printable Version
Forum Jump:


Users browsing this thread: 1 Guest(s)
Contact UsTeam Spartan Cookies & MilkReturn to TopLite (Archive) ModeMark all forums readRSS Syndication

Powered By MyBB, © 2002-2026 MyBB Group.