Ads
Tom's Guide > Forum > Applications > Programming > Scan Line Algorithm For Polygon Filling

Scan Line Algorithm For Polygon Filling

Forum Applications : Programming Scan Line Algorithm For Polygon Filling

Related Content
Can't find your answer?
Ask!
Word :    Username :           
 

Please explain scan line algorithm for polygon filling in simple terms.
Thanks

Reply to fasihxkhatib
Register or log in to remove.

It's like printing in an ink jet printer. You draw one colour line from left edge of the polygon to the right edge, then repeat the same thing from top of the polygon to the botomn.

Reply to theDanijel

And can u pls explain the program?

Reply to fasihxkhatib

Homework? If you have the algorithm it should be self explaning.
it should go something like this:
foreach poligon
{
determine top and botomn
define current point and set it to top
while current point is not botomn
{
calculate left and right edge of polygon on the current point's height
draw horizontal line from left to right
set current point to next moveing to botomn (when current point is the same as botomn the loop will end)
}
}

Reply to theDanijel

I get the algorithm. Algorithm is far from program.
I know the algorithm, need explanation for program.

Reply to fasihxkhatib

What program?
An implementation of this algoritm or a whole program? You need a whole program?

Reply to theDanijel

I have the CODE, entire. I just want an explanation of whats going on

Reply to fasihxkhatib

Then post the code. How can anyone explain what he doesn't see?

Reply to theDanijel

It is quite a long code in C. will post it as soon as Im done typing it.

Reply to fasihxkhatib
TomsGuide.com: Over 800,000 questions and answers to address all your high-tech questions. Sign up now! Its free!
Tom's Guide > Forum > Applications > Programming > Scan Line Algorithm For Polygon Filling
Go to:

There are 52 identified and unidentified users. To see the list of identified users, Click here.

Tom's Guide around the World