I\'m learning OpenGL and I want to get a surface with a slight hump in the middle. I\'m currently using this code and im not sure how to adjust the ctrl points to make it the wa
Even though it's hard to match in completeness and presentation the answer of Rekin, there's something to be clarified:
The 'R' in NURBS stands for rational. This requires using homogeneous coordinates where each control point [x,y,z] is assigned a weight 1/w, which will be used to divide all the other elements, making NURBS control points really vectors of four elements. It's through this fourth element one can represent exactly circles, torii and spheres with NURBS, where as with regular bezier or spline curves one can only approximate circles.
The lucky thing is that with openGL one will quickly be at least familiar with the use of the element w, and this will eventually lead to understanding. (or illusion of that...).
If one uses a real NURBS modeler, one is really required to import also the fourth component, unless the modeler is programmed to export a non-rational surface approximation represented by 3 element vectors alone.