19
2012
Bresenham’s line algorithm (Unity javascript)

* image from wikipedia, public domain
Converted this function to Unity javascript: http://en.wikipedia.org/wiki/Bresenham%27s_line_algorithm
Notes:
It works..
Webplayer:
http://unitycoder.com/upload/demos/Bresenhamline/
Download webplayer source:
Bresenham.unitypackage
old unityscript source
https://gist.github.com/unitycoder/90f0f1896e38a13d98e3d0c84ea45789
Related Posts
10 Comments + Add Comment
Leave a comment
Recent posts
- Unity Editor: Tree Generator
- Leaf/Foliage Generator Tools (Runs in Browser)
- Testing Unity AI Beta
- Ways to Support UnityCoder Development
- Using UI Slider to Create 5-Star Rating Element
- Game Music Library For Unity (editor plugin)
- Fontastic : Easily Test Fonts in Unity Editor!
- GeoTiff Importer & Terrain Generator for Unity
- Create Baked DropShadow for UI images
- .JP2 Ortho Image Converter to PNG/JPG/TIFF
- Convert LAS/LAZ/PLY pointclouds to GLTF (GLB) Point Meshes (standalone converter)
- Detect SRP (URP or HDRP) with Assembly Definition Version Defines
Recent Comments
- on Sprite Sheet Flip Book Shader
- on Sprite Sheet Flip Book Shader
- on [Asset Store] PolygonCollider2D Optimizer
- on Trajectory Test Scene 2.0
- on Vector3 maths for dummies!
- on UnityHub 3.6.0: Remove Version Control & Cloud Dashboard columns
- on Using RenderDoc with Unity (graphics debugger)
- on UI Scroll View automatic Content height
Coin:
CUgDSbRqFcAumDSAcdKDvuXsw26VdkJe8C8WGUQHBAGS
An article by












Line Drawing on Raster Displays:
http://www.cs.helsinki.fi/group/goa/mallinnus/lines/gsoft2.html
texture drawline:
http://wiki.unity3d.com/index.php?title=TextureDrawLine
simple implementation to plot lines, circles, ellipses and Bézier curves:
http://members.chello.at/~easyfilter/bresenham.html
For some reason this “Anti-aliased thick line” doesnt work, its missing some parts of the line, if anyone gets it to work, please tell me 🙂
http://members.chello.at/~easyfilter/bresenham.html
new versions of bresenham lines:
http://beaugg.blogspot.fi/2013/03/beyond-bresenham-new-algorithms-for.html
bresenham (js)
http://rosettacode.org/wiki/Bitmap/Bresenham%27s_line_algorithm#JavaScript
DDA line rasterizer
https://twitter.com/CasualEffects/status/954729006762483713
bresenham and DDA
https://github.com/Chris3606/GoRogue/blob/master/GoRogue/Lines.cs#L88
shadergraph line:
https://forum.unity.com/threads/linerenderer2d-gpu-pixel-perfect-2d-line-renderer-for-unity-urp-2d-renderer.1021708/
simpler line with ints
https://twitter.com/Enichan/status/1445294504177700864/photo/1