This code is taken from
 http://stlab.adobe.com/
