Matt Fowles's Graphics Lab 3


For this lab, I was to implement basic filled primitives. Fortunately, I had already done the filled circles and ellipses in the previous lab. The only difficulty that came up in that one was ensuring that I only drew one horizontal line for each pass through the loop. This was on the whole not difficult, but my first naive pass through the problem did not deal with this correctly.

Rather than use any of the supplied code for the scanline fill (which looked somewhat painful), I decided to just cut my own version. The approach was to calculate all the points ahead of time, and then draw the lines based on the sorted set of points. It worked pretty well, although I have yet to determine why it is so slow.


Is your polygon algorithm consistent with respect to screen coordinate issues, and does it produce rectangles that are the correct area? What changes to the algorithm did you have to make in order to make it consistent?

I think so. I had been shifting my lines to account for screen coordinate issues, and as long as the polygons are created in a counter-clockwise manner, they should be correct. I did not use a presupplied algorithm, so there were no "changes" to it.
A square...
RectTest.png
The car is getting better too. Although I decided that I liked it better with a black side panel...
FillCar.png
The required image with coordinates
  • (30, 30)
  • (80, 40)
  • (50, 60)
  • (80, 80)
  • (50, 80)
  • (40, 70)
  • (30, 80)
FillTest.png



How many filled polygons of a reasonable (400 pixels < area < 1000 pixels) size and complexity (5-7 edges) can your algorithm draw in 1 second?

RectSpeed.png I did not actually do the size checking for these polygons, just gave them all 6 random points. As a result some of them are not oriented counter-clockwise, but that does not really matter for the speed test.
Sample runs:
428
270
439
434

My system is a win2k machine with 256 MB ram and a 700 mhz processor. I did have a few heavily load apps open at the time (VC++, IE, and Outlook), but even so this seems god-awfully slow...



How many filled circles of a reasonable size (10 pixels < r < 20 pixels) can your algorithm draw in 1 second?

CircleSpeed.png The speed of the circles was much better, although I am not really sure as to why.
Sample runs:
26322
26360
26267

My system is still a win2k machine with 256 MB ram and a 700 mhz processor. I did have a few heavily load apps open at the time (VC++, IE, and Outlook).



If you extended this assignment in any way, describe what you did and how you did it. Include pictures, or links to pictures that show what you did.

Only the flood fill from Lab 2...


Other stuff?

I have not yet updated my GUI.

Last modified 2003-10-07 22:15 EST