Bezier surface glEvalMesh2 question

Hi guys,

I’m trying to draw a colored bezier surface. I have no issue whatsoever drawing my bezier surface using the pseudocode below:

glMap2d( GL_MAP2_VERTEX_3, … );
glEnable( GL_MAP2_VERTEX_3 );
glMapGrid2d( … );
glEvalMesh2(GL_FILL, …);

My question is this. Can I have each control point have a certain color that is blended in-between to show a multi-colored surface.

In other words, suppose i have a 5x5 grid of control points. I’ll end up with 25 control points on my surface. I want each of these control points to have a specific color and it is blended with the colors of neighbouring control points.

I have this is possible.

Do reply.

Thank-you in advance.

Looked at the redbook examples?

Evaluators are deprecated, btw.

Hi modus,

Yea i did look at the redbook examples. But I can’t find one where each control point has a different color. Do you have a specific example in mind?

tnx

That should be as simple as reading the manual for glMap2f(). :wink:
Same procedure as your glMap2d( GL_MAP2_VERTEX_3, … ); and glEnable( GL_MAP2_VERTEX_3 ); calls.
Just add another glMap2f() call with target GL_MAP2_COLOR_4 and the proper values in that grid, plus glEnable( GL_MAP2_COLOR_4).
(I’d recommend using floats.)

Hi relic,

thank you for your reply. That’s exactly what i needed. :slight_smile: