ogldev1 said:
I just can't get the difference between quad and triangle meshes (obj file).
GPUs can't render quads, so at some point conversation to triangles is necessary.
But usually we want to do this as late as possible, because quads have advantages in modeling and geometry processing.
The obvious advantage is that most parametric surfaces generate quads, and subdivision surfaces generate smoother results using quad dominant meshes.
The lesser obvious advantage is that primary and secondary curvature directions on any surface are normal to each other, so the edge flow of quads can represent local curvature more accurate than equiangular triangles. (While triangles give us smoother singularities than quads, so there is no clear winner.)
So that's some reasons why quad meshes will keep around.
Also, is there a way (like an online tool) to reformat a QUAD obj file to triangles ?
Any 3D modeling tool can do this for you. E.g. Blender, which can also be used to batch process many files.
At some point you may want to support more file formats than obj. E.g. to support multiple UV maps, skinning, etc. You may decide to use a import library like Assimp, which also can triangulate quads or polygons.
If you want to implement triangulation yourself, the question is which of the two options to split a quad to choose. An easy answer is to pick the shorter splitting edge, following the idea of Delauney Triangulation.
But often that's not really good and creates jaggy curvature. The better option is to calculate primary curvature direction of the quad and pick the edge closer to that. But calculating curvature directions is not trivial or easy, which is probably the reason all 3d modeling tools i ever tried sucked at triangulating quad meshes. Maybe they improved in recent years.
However, it's not that important, and the easy route is good enough i guess.