Plotting surfaces

I’m making a program to plot functions using surfaces: i’ve got an array with points and have to create a surface using them. I’ve heard about an algorithm called “painter algorithm” or similar.

Anybody knows how to implement this “painter algorithm”?
Is there any OpenGL function or code to create a surface from a given set of points?

Thanks in advance

the painters algorithm has (to my knowledge) little to do with this. It deals largly with drawing things properly w/o a depth buffer ie further stuff gets drawn first.
What you want to do can be very simple, or it can be very difficult. It depends on your data. If it is just a point cloud, you need to use something like Delaunay triangulation (search google) on the other hand if you have simpler data you could come up with a simpler algorithm, it all depends.