bezier emergency i get madddddd

Good day opengl people!
I have trouble with bezier!!
I prepare a array of points[512][512][3]
now i dont know how to set up the glMap2 function and glEvalMesh to read that array…
I did several test but the only one that display something but not wath i want is the following commands lines:

glMap2f(GL_MAP2_VERTEX_3,
0.0f,1.0f,
3, //Is right?Each trhee elements i have 1 u?
4,//Is right? 4=dimension+1?
0.0f,1.0f,
3512,//is right? Each 5123 i have 1 v?
4,//is right?dimension+1?
&points[0][0][0]);
glEnable (GL_MAP2_VERTEX_3);
glMapGrid2f(10,0.0f,1.0f,10,0.0f,1.0f);
glEvalMesh2(GL_FILL,0,512,0,512);

If i have an array of points[512][512][3]
how can i do that that array become the control point array? i want to do that all those points control a surface… i hope someone can replay to me and did still read a lot of tutorials but no way for me to understand perhaps because my mother speech is italian too…i really need help if someona would give me some example very very explicatifs…thanks to all good day to you!