|
BUG REPORT: polygon(,,,,) |
fuzinavl
Member #4,105
December 2003
|
2d polygon(,,,,) function does not render the lowest row of pixels. I'm using allegro 4.1 and devc++. __________________________ |
Fiddler
Member #5,385
January 2005
|
Please, try the latest version of Allegro (4.2.0 beta1) and see if the problem persits. The Open Toolkit: a game development library for .Net/Mono. |
gillius
Member #119
April 2000
|
I don't know about this specific case, but please note that almost all graphics libraries on purpose do not draw the left-most or right-most or whatever-most pixel of a polygon, because if you paste together polygons you want to be able to prevent any overdraw (which becomes extremely critical if the polys are transparent -- if you drew all pixels you would see 1 pixel lines at the poly borders). Gillius |
fuzinavl
Member #4,105
December 2003
|
Stephen: I will once the download is available in a precompiled mingw library & alleg42.dll. ( I'm lazy Gillius: If that is the case, then the right-most pixels should not be drawn either; but they are. __________________________ |
Elias
Member #358
May 2000
|
polygon3d_f draws neither the right nor the bottom pixels. So probably, since triangle and polygon draw the right pixels, they should draw the bottom pixels as well. Do you have a patch to correct this? If not, I'll have a look at polygon.c. -- |
Fladimir da Gorf
Member #1,565
October 2001
|
I think there should be a parameter that tells if the right and leftmost lines should be skipped. OpenLayer has reached a random SVN version number ;) | Online manual | Installation video!| MSVC projects now possible with cmake | Now alvailable as a Dev-C++ Devpack! (Thanks to Kotori) |
Elias
Member #358
May 2000
|
I see no need. You use polygon if you don't want them skipped, polygon3d otherwise. -- |
Evert
Member #794
November 2000
|
This issue has come up and been discussed before. I don't know if a patch was ever submitted or if any reason has been given why this should not be done. |
Elias
Member #358
May 2000
|
I also seem to remember something, but a search revealed nothing. Anyway, there's no reason to make it not either skip the right pixels, or draw the bottom ones. And seeing how we have line, rectangle, triangle, polygon all together in the docs, they should all behave the same (so draw the right and bottom pixels). -- |
ReyBrujo
Moderator
January 2001
|
Elias
Member #358
May 2000
|
Ah, yes, that explains it.. must have read one of those threads on the forums. Nothing ever went through to [AD] though. I'll make a patch later to fix it (well, assuming, it is a quite simple case of changing a y < height to y <= height in a for loop). -- |
fuzinavl
Member #4,105
December 2003
|
I found a thread with possible {code} solutions: Elias' avatar __________________________ |
Elias
Member #358
May 2000
|
Quote: I found a thread with possible {code} solutions: Ah, great. I wonder how that was missed.. someone really should have forwarded it to [AD] when no devs noticed it. Luckily I didn't get around yet to look at it, so now can just create a patch from Surt's code Thanks for finding it! Quote: Elias' avatar [that is, i had the same avatar since years.. me looks puzzled] [Edit:] [Edit2:] -- |
fuzinavl
Member #4,105
December 2003
|
I know it's tempting to want to do all scanlines in a single, perfect pass. Is there any major reason why the very bottom scanline couldn't be done as a __________________________ |
Elias
Member #358
May 2000
|
They are sorted as far as I see. So yeah, they could be done as a separate pass. Maybe it's the best. So, it would mean, walking the polygon edges, detecting minima, and figuring out the length of a hfill to draw at every such minimum. -- |
fuzinavl
Member #4,105
December 2003
|
I'm not sure how the algorithm works, but is there a way If so, the last scanline won't take any more work than the __________________________ |
Elias
Member #358
May 2000
|
There can be multiple last scanlines (e.g. an M shaped polygon has 3 minima), so it's not completely easy. It's easy enough once the algorithm used is understood, I guess. -- |
fuzinavl
Member #4,105
December 2003
|
I like Fladimir's idea of a separate boolean parameter to fill out the right and bottom edges or not. Another way is to let __________________________ |
Elias
Member #358
May 2000
|
Yes, I like the idea as well.. it gets one step closer to OpenGL polygons But anyway, maybe we should think about making polygon a simple wrapper around polygon3d, and add the possibility for borders to that. It doesn't look like anyone is up to fixing the code in polygon.c anyway. Now if it's easier to add optional right and bottom edges to the polygon3d code, I have no idea.. -- |
fuzinavl
Member #4,105
December 2003
|
What would people use "unshaved" 3D polygons for? __________________________ |
Elias
Member #358
May 2000
|
For example, I often use rectangle. -- |
|