Algorithm for a triangularized polygon

xiaoxiao2021-03-06  39

During using the OpenGL drawing, since OpenGL does not support direct drawing recess, we usually need to convert the concave polygon into a set of triangles below a triangular polygon algorithm.

1) Save the polygonal vertex with the one-way circulation chain table and calculate the lagging of each vertex in this linked list.

2) Take three nodes P, Q, R in the circulating chain table, if Q is a bump, and the triangular PQR composed of P, Q, and does not include other vertices on the polygon, calculate the characteristic angle of ΔPQR. (Minimum angle in the triangle). The triangle has such a triangle, selecting the maximum characteristic angle to the maximum value, saves the triangle, and deletes the node Q from the list.

3) If there are no three vertices in the linked list, turn step 2).

4) The last three vertices in the chain form a triangle.

转载请注明原文地址:https://www.9cbs.com/read-65050.html

New Post(0)