Hi,
I´m trying to look into the Extension GL_NV_evaluators, but I don´t seem to understand the whole stuff.
-
Do I have to set up control points for every Vertex Attribute (one for vertex position, one for TexCoords etc.)?
-
Is there a rule how many control points I have to use (a minium number of ctrl points)?
-
For what is the 4th value used in the ctrl points array? First three are X, Y, Z (vertex position), but the 4th?
-
Where can I find a detailed description or an REALLY easy example on how to use the glMapControlPointsNV command?
OK, currently I got the following:
- parameter = patch type
- parameter = vertex attribute register no.
- parameter = GL_FLOAT or GL_DOUBLE
- parameter = ustride
- parameter = vstride
4 + 5 = the numbers of basic machine units (typically unsigned bytes) between control
points in the u and v directions, but WHAT does that mean? - parameter = uorder
- parameter = vorder
6 + 7 = uorder and vorder have the same
meaning they do in the Map2{fd} command.
My red book sais: Finally, the order parameters uorder and vorder, can be different - allowing patches that are cubic in one direction and quadric in the other, for example. Really not a good explanation . - parameter: packed = true oder false
Guess I could teach me that on my own, IF i would understand the other missing parts of the puzzle . - parameter: pointer to the ctrl points array, OK that´s clear
Here is the code I try to use, Vertex position works, but texture coordinates are messed (and remember I dunno the correct meanings of the glMapControlPointsNV parameter g):
float CPTS[4][4][4] = {{{-0.6, 0.6, 0, 1}, {-0.2, 0.6, 0, 1}, {0.2, 0.6, 0, 1}, {0.6, 0.6, 0, 1}},
{{-0.6, 0.2, 0, 1}, {-0.2, 0.2, 0, 1}, {0.2, 0.2, 0, 1}, {0.6, 0.2, 0, 1}},
{{-0.6, -0.2, 0, 1}, {-0.2, -0.2, 0, 1}, {0.2, -0.2, 0, 1}, {0.6, -0.2, 0, 1}},
{{-0.6, -0.6, 0, 1}, {-0.2, -0.6, 0, 1}, {0.2, -0.6, 0, 1}, {0.6, -0.6, 0, 1}}};
glEnable(GL_EVAL_VERTEX_ATTRIB0_NV);
glEnable(GL_EVAL_VERTEX_ATTRIB8_NV);
glMapControlPointsNV(GL_EVAL_2D_NV, 0, GL_FLOAT, (4 * sizeof(GLfloat)), (4 * 4 * sizeof(GLfloat)), 4, 4, GL_TRUE, CPTS);
glMapControlPointsNV(GL_EVAL_2D_NV, 8, GL_FLOAT, (4 * sizeof(GLfloat)), (4 * 4 * sizeof(GLfloat)), 4, 4, GL_TRUE, CPTS);
glEvalMapsNV(GL_EVAL_2D_NV, GL_FILL);
I really hope, there are people here, that are willing to help me .
Regards,
Diapolo