Sunday, 29 September 2013

fill random area with color

fill random area with color

I need to fill any random area with color. I have several points with some
coordinates(number of points > 2). (I should get points by mouse clicking
-> random points). So to test filling with color I use some random points
glBegin(GL_POLYGON);
glVertex2f(200.0 / WIDTH, 300.0 / HEIGHT);
glVertex2f(300.0 / WIDTH, 100.0 / HEIGHT);
glVertex2f(500.0 / WIDTH, 400.0 / HEIGHT);
glVertex2f(400.0 / WIDTH, 200.0 / HEIGHT);
glEnd();
But the result does not look like it supposed to be
I know that points should be in some specific order - but how to apply it
to random points?

No comments:

Post a Comment