PDA

View Full Version : NURBS and picking



JMR
07-23-2002, 01:59 AM
Hello,

I'm trying to implement a picking feature to my 3D scene using gluPickMatrix(). This works fine... except for nurbs objects !

First I would like to know is there is special known problem with picking nurbs ?

More explanation now...
Here is my rendering routine :

struct volume *pvol;
GLfloat knots[6] = < knots definition here >
GLfloat ctrlpts[3][3][3] = < control points definition here >

pvol=pvol0;
while(pvol != NULL){
if (mode == GL_SELECT) {
glLoadName(pvol->id);
}

< some code... >

switch (pvol->type){
case SPHERE:
glutSolidSphere(pvol->size, 36, 36);
break;

< some code managing other kind of objects >

case NURBS:
printf("plotting Nurbs \n");
gluBeginSurface(theNurbs);
gluNurbsSurface(theNurbs,
6, knots, 6, knots,
3 * 3, 3,
&ctrlpts[0][0][0],
3, 3, GL_MAP2_VERTEX_3);
gluEndSurface(theNurbs);
printf("Nurbs done \n");
break;
}
pvol = pvol->psuiv;
}

This compiles fine. But when I run the program, when the routine is called in GL_SELECT mode, application is hanging on nurbs rendering : the "Nurbs done" string never written despite "plotting Nurbs" is written. Behaviour in GL_RENDER mode is OK.

Any help would be very appreciate...

I'm using Linux Mandrake 8.2 with XFree86-devel-4.2.0
libMesaGLU1-devel-4.0.1 and
libMesaglut3-devel-4.0.1-4mdk
I have a nvidia TNT2 card with last nvidia driver.