🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

nurbs...

Started by
0 comments, last by AlexM 24 years, 6 months ago
anyone know of some good NURBS articles on the internet, programming applicable preferably?

Thanks in advance!

Advertisement
Hi Alex,
I also search around for this topic.

When you use OpenGL you could look for some example source codes form Mark J. Kilgard (the developer of GLUT). I guess he provides the example I am talking about, included with the GLUT 3.7 source code .
Here are some GLU functions for NURBS renderingm, but GLU can only render NURBS. When you want to tesselate/calculate the vertices and/or normals of a NURBS curve you must look for an GLU 1.2-imp that provides the extension glu_ext_nurbs_tessellator. Or you just wait for OpenGL 1.2 and GLU 1.3
Manage a NURBS object:

GLUnurbsObj* gluNewNurbsRenderer (void);
void gluDeleteNurbsRenderer (GLUnurbsObj *nobj);
void gluNurbsCallback (GLUnurbsObj *nobj, GLenum which,
void (*fn)( ));

Create a NURBS curve:

void gluBeginCurve (GLUnurbsObj *nobj);
void gluEndCurve (GLUnurbsObj *nobj);
void gluNurbsCurve (GLUnurbsObj *nobj, GLint nknots, GLfloat *knot,
GLint stride, GLfloat *ctlarray,
GLint order, GLenum type);

Create a NURBS surface:

void gluBeginSurface (GLUnurbsObj *nobj);
void gluEndSurface (GLUnurbsObj *nobj);
void gluNurbsSurface (GLUnurbsObj *nobj, GLint uknot_count,
GLfloat *uknot, GLint vknot_count, GLfloat *vknot,
GLint u_stride, GLint v_stride, GLfloat *ctlarray,
GLint uorder, GLint vorder, GLenum type);

Define a trimming region:

void gluBeginTrim (GLUnurbsObj *nobj);
void gluEndTrim (GLUnurbsObj *nobj);
void gluPwlCurve (GLUnurbsObj *nobj, GLint count, GLfloat *array,
GLint stride, GLenum type);

Control NURBS rendering:

void gluLoadSamplingMatrices (GLUnurbsObj *nobj,
const GLfloat modelMatrix[16],
const GLfloat projMatrix[16],
const GLint viewport[4]);
void gluNurbsProperty (GLUnurbsObj *nobj, GLenum property,
GLfloat value);
void gluGetNurbsProperty (GLUnurbsObj *nobj, GLenum property,
GLfloat *value);

There also two articles in GamdevNet, I guess.

This topic is closed to new replies.

Advertisement