/Liang-Barsky

Implementation of the Liang-Barsky line clipping algorithm (in Ruby)

Primary LanguageRuby

Liang-Barsky

This is an implementation of the Liang-Barsky line clipping algorithm I hacked together when developing a game. Thought it might be useful to others.

(Note: Differs from traditional implementations in that the origin is in the top left corner, not bottom left. This makes this implementation more appropriate for game development -- for example using Gosu).