The goal is to build a surface in OpenGL (but this is not the essence of any toolkit). The surface is given by a function, with sines, cosines.
The main problem is that I don’t understand how to build this surface correctly. The simplest idea that came to mind is to split the construction area into a grid, and connect the nodes as rectangles. But then a problem arises: what if the points lie in a different plane. By definition, any plane is defined by three points, which means a triangle. So it is necessary as it is divided into triangles. But so far, nothing has come to mind.
Maybe there are some ideas? Smash like a grid, and then build as triangles is also not quite suitable. Take four points, (0, 1, 0), (0, -1, 1), (1, 1, 1), (1, -1, 0). So, it turns out that for these four points, we can build as many as 4 triangles. And which one to choose then. Does this approach not quite suit me, or do I demand too much in this case?
