Simple AS3 Line Smoothing
While researching for drawing tools, I’ve come up with a simple implementation of a pencil tool and line smoothing.
Here’s the idea:
- Capture the points drawn by pencil tool in an array.
- Filter a new points array from the original one by skipping points in the middle (to reduce turns & angles)
- Finally, use a simple point-to-point curve drawing algorithm. I use sample code from this article by gskinner.com
The result:
You can find the source of this demo here.
[Vietnamese tag: Làm mượt nét vẽ đơn giản với ActionScript]