CodingTrain / Suggestion-Box

A repo to track ideas for topics
571 stars 86 forks source link

Bresenham's line algorithm #336

Open Gust09 opened 7 years ago

Gust09 commented 7 years ago

Could you please make an example of Bresenham's line algorithm? I'm thinking about creating a "graphics engine" inside minecraft using blocks to display really simple stuff like a text, or a scrolling text and maybe a few shapes it would help to see some basics in action. And you videos are really easy to follow.

Thanks.

CincyAndroiDeveloper commented 5 years ago

These would be a very fun coding challenge. Line drawing seems very easy, simply drawing dots in between two x, y coordinates and boom you're done. It's not until testing that simple naive algorithm where you really learn that it creates very irregular lines, and breaks when the second set of x,y coordinates are smaller than the first. A Bresenham line algorithm (like ) is decently complex and involves more maths than one would expect. I'd personally love to see a video demonstration of this algorithm.