-
help how to make polygon
plz tell how to write the program for filling a polygon in electronic fashion and u may fill it with pixel and first generate a polygon as shown below then fill the polygon, all slope lines are 45 degrees.
__________________
| |
| |
| |
| |
| |
| |
| /\ |
| / \ |
| / \ |
| / \ |
| / \ |
| / \ |
|/ \ |
\ |
\ |
\ |
\ |
\ |
\ |
\ |
\ |
\ |
\ |
\ |
\ |
\|
-
> how to write the program for filling a polygon
goto www.google.com
type in
polygon fill algorithm
Start reading
-
Sorry hun, this belongs more to the world of OpenGL.
-
Using Win32 primitive drawing, you could use this function:
BOOL Polygon(HDC, hDC, CONST POINT* pt, int iCount);
All you have to do, is to fill an array with points.. and it will connect them for you.
Code:
void GamePaint(HDC hDC)
{
POINT points[3];
points[0] = { 5, 10};
points[1] = {25, 30};
points[2] = {15, 20};
Polygon(hDC, points, 3);
}