I have a wavefront loader, however it only works with triangular meshes.

I have been trying to think how to handle faces with arbitrarily many vertices but I have no idea how they are to be handled as ultimately everything needs to be given to the GPU as triangles and I cannot think fo a way to mape any arbitrary n-gon to triangles.

Like I know how to convert a quadrilateral to two triangles, but my way won't work for quintalaterals for example.

  • 1
    $\begingroup$ All convex n-gons can be represented using a triangle fan, using the first vertex as the centre of the fan and every other vertex (1+n), this is assuming the vertices are CCW order. $\endgroup$ – PaulHK Jun 23 '18 at 7:48
  • 1
    $\begingroup$ If you have nonconvex polygons, you would need to perform triangulation, e.g. using an ear clipping algorithm. I'm not sure how nonplanar nonconvex polygons are usually handled. $\endgroup$ – Rahul Jun 23 '18 at 10:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.