View Full Version : Loading Control Points

07-20-2005, 09:02 PM

I have been looking into bezier curves and all the tutorials I find have the control points already allocated at the top of the program. I was wondering, how could I load these from a file?


Ehsan Kamrani
07-20-2005, 10:14 PM
Some lessons of NeHe have used from a function to load the data from a text file. See lesson 10 or 25 of NeHe. you write your control points into the text file and then read the values of the text file.

07-20-2005, 11:46 PM
I am able to load the points now, but I cannot load them into mp Bezier map, the code says that the last parameter of glMap2f to a float or integer, it has to be a const.

07-21-2005, 01:15 AM
void glMap2f(GLenum target,
GLdouble u1,
GLdouble u2,
GLint ustride,
GLint uorder,
GLdouble v1,
GLdouble v2,
GLint vstride,
GLint vorder,
const GLfloat *points)If I am not mistaken the last parameter must just be an array of (or pointer to) GLfloat, the const meaning that glMap2f itself won't modify the data.

So don't worry.