20 April 2010

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:

Click to view the demo

You can find the source of this demo here.

[Vietnamese tag: Làm mượt nét vẽ đơn giản với ActionScript]

1 comment:

  1. Awesome =) thanks for this, its was very useful thanks for sharing!

    ReplyDelete