Skip to main content
↑
↓
Spherical forums
Community for the
Sphere game engine
New?
Contact Us
to register an account!
1 Hour
1 Day
1 Week
1 Month
Forever
Community
Help
Search
Recent Posts
Log in
Contact Us
News
Spherical
Facebook
-
Twitter
-
Discord chat
New?
Contact us
to register an account!
Creations
Programming
Wu Lines - better than Bresenham!
1
Print
Topic: Wu Lines - better than Bresenham!
(Read 5533 times)
previous topic
-
next topic
0 Members and 2 Guests are viewing this topic.
N E O
Hero Poster
Posts: 585
Making it happen!
Logged
Administrator
Senior Administrator
Wu Lines - better than Bresenham!
November 25, 2013, 02:08:08 pm
An article and pseudocode implementation for Wu Anti-Aliased Lines, a fixed/floating point implementation of a line drawer from a Michael Abrash book:
http://freespace.virgin.net/hugo.elias/graphics/x_wuline.htm
I use it for my line function in my
open-source phoenix tutorial app
!
DaVince
Legendary Poster
Posts: 1,001
Logged
Administrator
Used Sphere for, like, half my life
Re: Wu Lines - better than Bresenham!
Reply #1
–
November 25, 2013, 02:52:01 pm
I dunno. You say it's better, but in your screenshot the lines look like dotted lines instead of straight, unbroken lines. The lines at the bottom of the linked page look good, though.
Spherical Downloads Repo
||
My (really old) Sphere stuff
N E O
Hero Poster
Posts: 585
Making it happen!
Logged
Administrator
Senior Administrator
Re: Wu Lines - better than Bresenham!
Reply #2
–
November 25, 2013, 03:20:49 pm
I probably should've highlighted the fact that Wu lines are for anti-aliased lines. Re my specific implementation, I wouldn't be surprised if I screwed something up along the way. :/
Flying Jester
Legendary Poster
Posts: 1,161
Logged
TurboSphere Developer
Re: Wu Lines - better than Bresenham!
Reply #3
–
November 25, 2013, 04:38:06 pm
It looks like each row/collumn in the weaker direction is not heavy enough. Like it just needs a little tweaking.
Learn some history?
The Flying Jester's Blog of Sorts
N E O
Hero Poster
Posts: 585
Making it happen!
Logged
Administrator
Senior Administrator
Re: Wu Lines - better than Bresenham!
Reply #4
–
November 29, 2013, 02:04:42 am
Indeed, I screwed up my implementation. I passed the wrong colors to the plot function assuming that the multiplication was going to work a certain way; everything else was fine, though.
It is now fixed!
Radnen
Big Chungus
Posts: 1,440
Sphere Studio Developer
Logged
Senior Staff
Wise Warrior
Re: Wu Lines - better than Bresenham!
Reply #5
–
November 29, 2013, 02:35:38 pm
Sweet! That's some awesome stuff right there,
If you use code to help you code you can use less code to code. Also, I have approximate knowledge of many things.
Sphere-sfml
here
Sphere Studio editor
here
DaVince
Legendary Poster
Posts: 1,001
Logged
Administrator
Used Sphere for, like, half my life
Re: Wu Lines - better than Bresenham!
Reply #6
–
November 30, 2013, 10:29:16 am
Looks much better!
Spherical Downloads Repo
||
My (really old) Sphere stuff
1
Print
Creations
Programming
Wu Lines - better than Bresenham!