![]() |
Drawing an ellipse - Printable Version +- NaaLaa Forum (http://www.naalaa.com/community) +-- Forum: NaaLaa (http://www.naalaa.com/community/forumdisplay.php?fid=1) +--- Forum: Showcase (http://www.naalaa.com/community/forumdisplay.php?fid=4) +--- Thread: Drawing an ellipse (/showthread.php?tid=47) |
Drawing an ellipse - Marcus - 04-06-2018 The draw ellipse command is of course written in C. But I first implemented it in naalaa (which is way easier than rebuilding the runtime for every change). Here's the code I was experimenting with, for the fun of it. The filled version caused some problems. If any pixel was drawn more than once, it wouldn't work with transparency (some areas of the ellipse would be less transparent than others), so I had to draw horizontal and vertical spans depending on the quadrant. Code: set redraw off The code is based on this paper: https://dai.fmph.uniba.sk/upload/0/01/Ellipse.pdf RE: Drawing an ellipse - johnno56 - 04-06-2018 Very nice. I was expecting maybe a simple ellipse, but a whole screen full of various sizes and transparency - AND filled. Did I mention very fast? Draws SO much quicker using four start points. Very cool. Well done. I have to say, THAT, is a Darth Vader moment!! J |