flash哈哈镜效果|ps球面化滤镜源码下载

[img]/uploads/allimg/090211/0827310.png[/img] package { import flash.geom.*; import flash.display.*; public class Spherize {   private var r:Number;   private var h:Number;   private var pointCenter:Point;   private var isSmoothing:Boolean;   public function Spherize(r:Number,h:Number,pointCenter:Point,isSmoothing) {    init(r,h,pointCenter,isSmoothing);   }   public function init(r:Number,h:Number,pointCenter:Point,isSmoothing):void {    this.r=r;    this.h=h;    this.pointCenter=pointCenter;    this.isSmoothing=isSmoothing;   }   public function getSpherizePoint(point:Point):Point {    var R:Number=(r*r+h*h)/(2*h);    var l:Number=Point.distance(point,pointCenter);    return Point.interpolate(Point.interpolate(point,pointCenter,r / l),pointCenter,Math.asin(l / R) / Math.acos((R - h) / R));   }   public function getSpherizeBitmapData(bitmapData:BitmapData):BitmapData {    var bitmapData1:BitmapData=bitmapData.clone();    var bitmapData2:BitmapData=bitmapData.clone();    var point:Point=new Point();    for (var i:int=pointCenter.x-r; i[1b]源码: [img]/uploads/allimg/090211/0827311.gif[/img] [url=http://www2.flash8.net/UploadTeach/200901/20090121175403590.rar]Spherize.rar[/url] [/1b] 本文转自:http://www.5uflash.com/flashjiaocheng/Flashaschengxu/4801.html

你可能感兴趣的:(html,.net,Flash)