DescriptionDraw anti-aliased lines in SmileBASIC!
This program draws anti-aliased lines using Xiaolin Wu's line algorithm. I copied it almost verbatim so there is no optimization as of yet.
Future Plans
Color control
Speed optimization
Line thickness control
InstructionsRun the example or use the command in your programs.
5 Comment(s)DFrostExpert ProgrammerProgramming no longer gives me any trouble. Come to me for help, if you like!Programming StrengthI actually made an anti - aliasing algorithm a few days ago and it was insanely fast, but used sprites to work. a line from (0,0) to (200,20) @~1msSimeonScholarReceived for knowing a great deal about programming topicsAchievementsAmazing PageHiddenAchievementsDrawingI like to draw!HobbiesFantastic! This is interesting
However, it is very slow, I ran some tests:
On average it takes 9.87 milliseconds to draw a line across the screen
GLINE takes 0.019 milliseconds to do the same thing
So AALINE is approximately 496.33 times slower than GLINE
It is still very interesting
I'll definitely be studying this code in the future.hakkeRNGHiddenEaster EggsQSP Contest 2 Contest ParticipantI participated in the second SmileBASIC Source QSP Contest!Expert ProgrammerProgramming no longer gives me any trouble. Come to me for help, if you like!Programming StrengthBut Simeon, you didnt say that antialiasing was practically putting a 1pixel radius blur?
SimeonScholarReceived for knowing a great deal about programming topicsAchievementsAmazing PageHiddenAchievementsDrawingI like to draw!Hobbies¯\_(ツ)_/¯
Pass
Lol jk, but that's slightly unrelated because actual developers have a huge advantage of resources as opposed to SmileBASICians12Me21Syntax HighlighterReceived for creating the code syntax highlighter on SBSNight PersonI like the quiet night and sleep late.Express Yourselfdrawing a line with GPSET is already around 100 time slower than GLINE, so there's an upper limit to the speed of any alternate line drawing programs.
However, this algorithm actually draws TWO pixels in each position, so it would be 200x slower than GLINE, at best.