   Closed Nurbs
  Could anyone let me in on the secret?  I''m really just trying to make a couple of closed nurbs surfaces - circles, spheres, cylinders... but I''m just not having any luck with deciphering what needs to be put into a gluNurbsCurve/Surface to do so.  
  I have just completed some software (freeware) that allows the user to interactively create a scene using spheres, cubes,cones, etc., and nurb surfaces of revolution and extrusion. It then exports the scene as a stand alone OpenGL C program. Most of the nurb related code is contained in the file nurb.h which you can get at my sight. The software runs only on Windows right now.Nurb.h doesn''t have a lot of comments, and is definitely not an example of good programming style but it may be of some help to you. Here is the url http://www.cs.luc.edu/~gm/grex/grexintro.html ;  Cool, that works fairly well, but (and maybe this is just a problem with my curve values), for a unit half circle, (radius of 1, 5 points), I get kind of a bulb (pointy at the top and bottom), any good way to get rid of that?  (add more cvs, ...?) ;  I tried the following control points for my silhouette  (0,-4), (2,-4), (4,-2), (4.5,0), (4,2), (2,4), (0,4)and when I rotate it,it looks reasonably like a sphere. Does it have to be "exactly" a sphere?;  No, I''d be reasonably happy with just something that *looks* sphereish, but i''m actually more interested in just a closed curve, not a surface.  any idea how to make a closed circle?   ;  If you use these control points you get something which looks a lot like a circle:    (-10,0) (10,10) (-10,10) (-10,-10) (10,-10) (10,0);  Over the weekend I figured out how to get a real circle. You want to use homogeneous controlpoints so use  GL_MAP1_VERTEX_4. I tested the code below and it produced a perfect circle of radius 100. I also know how to do an exact sphere if you are interested.void NURB_circle( )  // for surfaces of revolution{int j;float B[][3]= {   { 1.0, 0.0, 1.0},{ 0.707, 0.707, 0.707}    ,{ 0.0, 1.0, 1.0},{-0.707, 0.707, 0.707}   ,{-1.0, 0.0, 1.0},{-0.707,-0.707, 0.707}   ,{ 0.0,-1.0, 1.0},{ 0.707,-0.707, 0.707}  ,{ 1.0, 0.0, 1.0}};GLfloat uknots[12] = {0.0, 0.0, 0.0,0.25,0.25,0.5,0.5,0.75,0.75, 1.0,1.0, 1.0};GLfloat curvectlpoints[9][4];GLUnurbsObj *theNurb;for (j=0;j<=8;j++){ curvectlpoints[j][3] =B[j][2];curvectlpoints[j][2] =0.0;    curvectlpoints[j][1] =100*B[j][1];curvectlpoints[j][0] =100*B[j][0];} // #knots = #control points + order of NURB - assuming quadratic order=3   numuknots=12;theNurb = gluNewNurbsRenderer();gluNurbsProperty(theNurb,GLU_SAMPLING_METHOD, GLU_DOMAIN_DISTANCE);gluNurbsProperty(theNurb,GLU_U_STEP,50);    gluBeginCurve(theNurb);   gluNurbsCurve(theNurb,   numuknots,uknots,    // number  and knots in u dir  4,  // u stride  &curvectlpoints[0][0],  //control points  3, // order of nurbs  GL_MAP1_VERTEX_4);    gluEndCurve(theNurb);    gluDeleteNurbsRenderer(theNurb);    glFlush();}  ;  Yeah, I''d love to know how to do a perfect sphere.   ;  The code is herehttp://www.cs.luc.edu/~gm/glrex/nurbsphere.html 