Manish Pansiniya's Blog

.NET, C#, Javascript, ASP.NET and lots more…:)

Simple Fill Polygon in OpenGL

with one comment

I am wondering around to find the fill polygon routine in OpenGL. I have closed shape as I am developing CAD/CAM application. And i needed to fill the close shape. In start, it seems difficult, but it is as simple as to eat PIZZA

Just convert the close shape to polygon and call following code to fill the polygon .

GL.PolygonMode(MaterialFace.Front, PolygonMode.Fill);
for (int j = 0; j < sides; j++)
GL.Vertex2(xPoints[j], yPoints[j]);


That’s all and the thing work like charm.

Simple but thought that it should be shared !!!

Written by Manish

March 20, 2009 at 3:45 pm

Posted in .NET, .NET 3.0, OpenGL

One Response

Subscribe to comments with RSS.

  1. But this not is to Irregular polygons. Only for simple polygons …… and the practical is very common found have irregular polygons


    December 15, 2011 at 1:46 am

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: