Request for code: Bresenham-Murphy line drawing

msteiger

Active Member
Contributor
World
Architecture
Logistics
Heya,
I was wondering if someone could help me out here. For the town generation module, drawing straight line segments is required to create town walls, streets, and so on. This is often achieved using the Bresenham algorithm.

However, for lines with a thickness > 1, Bresenham doesn't cut it. However, A. Murphy presents an extended version that is able to draw thick lines.

http://www.zoo.co.uk/~murphy/thickline/index.html

There's also a C++ implementation available (created by Pawel Piecuch):

komsoft.ath.cx/~pawelp/?x=entry:entry110711-163454

If someone could port this to Java (and maybe even adapt it to TS), we could create nice bridges and town wall with merlons, players can walk on.
 

Esereja

Active Member
Contributor
I hope you get help in this one. you have do lot for this project in so short time :).
 

msteiger

Active Member
Contributor
World
Architecture
Logistics
I found a nice C implementation for Arduino panels, which I was able to port to Java and adapt to Terasology code. First debugging results look promising:



Line clipping is still an issue and drawing seamless polyline, but we will eventually get there ...
 

ParticularTree

New Member
Hi,

I know it's over a year, but I stumbled upon your post and was wondering if you could share the code of the demo or give me a link to the Arduino library you mentioned?

Thanks!
 
Top