PDA

View Full Version : Evaluators..



M109uk
26-08-2004, 03:54 AM
Hi again,

This might be a really dumb question, but how exactly do you use evaluators.

I currently use the code:

var
ctrlPoints: Array of TVertex3f;
texPoints: Array [0..3] of TVertex2f;

begin
SetLength(ctrlPoints, numOfPoints);
For i := 0 To numOfPoints-1 Do
ctrlPoints := Points[i];

glEnable(GL_MAP2_VERTEX_3);
glEnable(GL_MAP_TEXTURE_COORD_2);

glMap2f(GL_MAP2_VERTEX_3, 0, 1, 3, 3, 0, 1, numOfPoints, 3, @ctrlPoints);
glMap2f(GL_MAP2_TEXTURE_COORD_2, 0, 1, 2, 2, 0, 1, 4, 2, @texPoints);

glMapGrid2f(15, 0, 1, 15, 0, 1);
glEvalMesh2(GL_FILL, 0, 15, 0, 15);


It renders fine, but i just dont really understand the coordinates?!
How exactly is the mesh rendered?

Thanx for any help

Paulius
26-08-2004, 10:08 AM
The way you do it should take three * three control points, the first one should be one corner, the third another corner, the second something you want between the first and the third point. The same relation would be between the first, seventh and fourth points and so on. You might want to draw some big points or something on control points to help you get the idea how they are evaluated.

M109uk
27-08-2004, 12:16 AM
Ok i think i understand, i managed to make a square anyway lol

thanx for your help :)