PDA

View Full Version : More than 10 Control Points for Bezier Curves?



zimwy
12-20-2003, 07:10 PM
Hi,
Is it not possible to use more than 10 control points for a bezier curve? I'm doing this:



const int numControlPoints = 10;
GLfloat controlPoints[numControlPoints][3];
glMap1f(GL_MAP1_VERTEX_3, 0.0, 1.0, 3, numControlPoints, &controlPoints[0][0]);

Don't worry, my control points are being initialized before I do this. So, what happens is when numControlPoints goes greater than 10, just my control points appear, no lines.

Should I instead use more than one array and join them at one vertex?

Does anyone know how it is possible to get an angled edge? In Photoshop I know you can choose to either make a control point an angle, or a control point. I'm thinking of just using more than one spline, but i'm not quite sure how to do that.

Also, is it possible to get the function that opengl is using for the curve, so I can test for line intersections against it?

Thanks!
gabe

[This message has been edited by zimwy (edited 12-20-2003).]

lazrhog
12-22-2003, 01:02 AM
On Nvidia cards they only implement 11 control points (I think), and ATI do about 31. The Blue book specifies just a minimum of 8.

I needed more, so I just implemented the appropriate functions myself from the algorithm in the blue book. It isn't too hard ....

zimwy
12-22-2003, 07:37 AM
Ahh Cool. That sounds good. Do you remember the name of the Bluebook? I only have the red one. http://www.opengl.org/discussion_boards/ubb/smile.gif

gabe

V-man
12-22-2003, 07:55 AM
The name of the Blue Book is The Blue book.

If you want to know the evaluator, then check your red book and the spec.

All evaluators use a basis function and the case of GL, it is the Bernstein polynomial.

You have to be careful on how you implement it though, because numbers may get too high in the polynomial and you may exceed float or double limits.

bunny
12-22-2003, 06:08 PM
The blue book is the OpenGL Reference Manual.