PDA

View Full Version : about NURBS surface



Mary
01-20-2004, 05:48 PM
I want to display NURB surfaces, read from IGES files of Ideas 4.0, with the
OpenGL glNurbSurface call.

I got all data (s&t knots, s&t orders and all control points from IGES files. But I have servere problems displaying surfaces with order > 2.

sknots:0.0,0.0,0.0,2.51934663,2.51934663,5.0386932 6,5.03869326,7.55803989,7.55803989,7.55803989
tknots:0.0,0.0,1.0,1.0
sorder:3
torder:2
control points:2336.83450222,842.6474008,0.0,
2336.83450222,842.6474008,2078.46096908,536.834502 22,842.6474008,1039.23048454,-1263.16549778,842.6474008,0.0,536.83450222,842.647 4008,-1039.23048454,2336.83450222,842.6474008,-207 8.46096908,2336.83450222,842.6474008,0.0,
2336.83450222,-807.3525992,0.0,2336.83450222,-807.3525992,2078.46096908,536.83450222,-807.3525992,1039.23048454,-1263.16549778,-807.3525992,0.0,536.83450222,-807.3525992,-1039.2304 8454,2336.83450222,-807.3525992,-2078.46096908,2336.83450222,-807.3525992,0.0

This is a cylinder


Hopefully somebody can help me at the moment.

mikael_aronsson
01-20-2004, 11:52 PM
Maybe you could be a bit more specific about the problem, does it display anything, does it crash ? what happens ?, maybe you should post the code that creates the nurb instead of the data, that would make it a little easier.

After all this is an OpenGL forum, not a nurb forum.

Make sure that you have correct number of knots and control points, make sure you pass the right arguments to the glu functions that generate the mesh.

Mikael

Mary
01-21-2004, 11:16 PM
Hello

I want to use gluNurbsSurface() to display it, but the graphic isn't right.
My code:
gluNurbsSurface(nurb,10,sknots,4,tknots,2*3,3,&ctlpoint[0][0][0],3,2,GL_MAP2_VERTEX_3);
Please tell me what is wrong.
Thanks a lot.

mikael_aronsson
01-21-2004, 11:50 PM
Hi !

It looks pretty ok to me, but I have not seen the result so it is difficult to say what is wrong, have you checked to control points ? just so that you got the ustride and vstride values correct ?

Mikael

Mary
01-23-2004, 04:54 PM
The ctrolpoints are from an iges file of ideas 4.0, I think ití»s right. But its arrangement is a triangle, I doní»t know if OpenGL can admit this kind of arrangement.

In addition Ií»m unclear how define the value of u_stride.

Thanks.

mikael_aronsson
01-23-2004, 10:58 PM
A triangular surface is tricky to do with nurbs surfaces, the result is never good because you get many control points in the same location so you cannot map a texture to it for example with any good result, but it should work.

The best solution for triangles are triangular spline surfaces and no there is no support for them in OpenGL.

The u and v stride is simply the offset from one control point to the next, +3 for "horizontal" movement and "width"*3 for "vertical" movement (next "row").

Mikael

Mary
01-24-2004, 04:52 AM
Thanks for your help.

But what is triangular spline surfaces? How do it? It can be trimed?

Because my English isn't good, hope you can use simple sentences to talk with me.Thank you.

pothik
03-09-2004, 04:27 PM
Hi,
I'm writing a repot on the math behind the I-DEAS (NURBS). Can anyone help letting me know any information availabe on that on any book/ any link or giving some information?
Wishes,

Pothik