View Single Post
Old 28 March 2014, 12:11   #1
Herpes
... aka Amix73
 
Herpes's Avatar
 
Join Date: Jan 2009
Location: Austria
Posts: 87
Eek Blitter poly-line draw & filling - the 100th

Hi guys!

In the last weeks I wrecked my brain to make a decent line drawing routine - not that there wouldn't be enough of and very optimized ones already in the thousands - but I wanted my OWN and without help - so to say reinventing my personal wheel . Well I managed it somehow and I happily found a nice solution to simplify the Octant finding by drawing all lines in the same direction thus concentrating on only one halve of the Octants (depending on the coordinate system up or down).

Sorry I try to keep it short....

Here are my problem(s):
When I then went on to filling - I found out that setting "single-bit" for lines is not enough. I read about EOR drawing mode and shaping the edges and the nice trick omitting the 1st pixel by pointing BLTDPT to a scratch area.

Anyway my routine still sucks - have a look - this is what happens if I use the eor edge trick...


which leads to the following when filled:


WHAT the heck I am doing here? Why are the two edges and ONLY the two edges are shifted to the left!?! I cannot figure it out myself ...
Any suggestions? Shall I post my routine or is this a common and boring mistake? I don't get it ...

ADDON: BTW I just found out if I draw my polygon without the eor of the edges and fill it - it works???
and

I thought I would have understand the eor manipulation of the edges but obviously I totally suck

Any hints appreciated, thanks!
Attached Thumbnails
Click image for larger version

Name:	sline_poly_Edge.png
Views:	2237
Size:	3.2 KB
ID:	39553   Click image for larger version

Name:	sline_poly_Edge_fill.png
Views:	2176
Size:	1.1 KB
ID:	39554   Click image for larger version

Name:	sline_poly_noEdge.png
Views:	2150
Size:	999 Bytes
ID:	39555   Click image for larger version

Name:	sline_poly_noEdge_fill.png
Views:	2144
Size:	1,008 Bytes
ID:	39556  
Herpes is offline  
 
Page generated in 0.05033 seconds with 12 queries