arx-tools / arx-level-generator

A node.js library for creating maps for the video game Arx Fatalis
MIT License
6 stars 0 forks source link

triangulate any n-gons #21

Open meszaros-lajos-gyorgy opened 2 months ago

meszaros-lajos-gyorgy commented 2 months ago

Arx can only handle triangles and quads, more complex planes need to be sliced up into smaller triangles. Should be done on threejs level.

Fan triangulation is a no go, because Arx uses vertex lighting, which focuses lighting information into the tips of the triangles. Something more evenly distributed is needed. image

meszaros-lajos-gyorgy commented 2 months ago

https://lindenreidblog.com/2017/12/03/simple-mesh-tessellation-triangulation-tutorial/

fredlllll commented 1 month ago

ear clipping might also be viable here https://en.wikipedia.org/wiki/Polygon_triangulation#Ear_clipping_method