How to triangulate a polyline with thickness (jvernay.fr)
from tedu@inks.tedunangst.com to inks@inks.tedunangst.com on 05 Jan 22:33
https://inks.tedunangst.com/l/5158

To render any geometric figure to a GPU (with OpenGL / Direct3D / Vulkan / ...), they must first be triangulated, i.e. decomposed as a series of triangles. Some figures are trivial to transform into triangles: for instance, a segment with thickness is represented by a rectangle, which can be rendered with two triangles. But a segment strip with thickness (aka. polyline) is not trivial.

Ultimately, this exploration has been a rabbit hole, also partly due to some digressions along the path โ€” letโ€™s prototype with a bare implementation of GeoGebra in vanilla JavaScript โ€” letโ€™s do a WebGL + WASM demo to verify the algorithm works correctly ... ๐Ÿ˜… At least, it gives some fancy interactive visuals for this blog post. ๐Ÿ˜

#c #gl #graphics #interactive #programming #visualization

#c #gl #graphics #inks #interactive #programming #visualization

threaded - newest