Normal horizontal line drawing issue
1 Attachment(s)
Hi!
I have no issue drawing line with blitter in order to do blitter polygon fill later. But now I want to draw normal lines. I patched the BLTCON0 & BLTCON1 to set "bset" instead of "xor" and also to draw all pixels ( and not only one per scanline ). Everything is working well, except for horizonal lines! Look at screenshot, when drawing horizontal lines of a standard cube, the lines are drawn like "vertical"??!! Any idea? |
Wrong octant when y1 == y2? Should be fine if you handle zero delta the same way as positive delta. So maybe just a case of a simple bpl/bgt/bge change...
|
Quote:
|
Code:
(x1,y1)(x2,y2) You will find discordant notations about the octant numbering almost everywhere. I opted for the 'natural' one for y increasing downwards (therefore in a clockwise direction, it is practically mirrored on x with respect to the Cartesian one). EDIT: when the point straddles two octants, you can choose any; I put condition (>=), but using (<=) instead of (<) could be fine too [I should try it] |
All times are GMT +2. The time now is 10:54. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.