이미지 왜곡필터

import flash.filters.DisplacementMapFilter;
import flash.geom.Point;
import flash.display.BitmapData;

var perlinBmp:BitmapData;
var displacementMap:DisplacementMapFilter;
var mclListener:Object = new Object();
mclListener.onLoadInit = function(target_mc:MovieClip):Void {
target_mc._x = (Stage.width - target_mc._width) / 2;
target_mc._y = (Stage.height - target_mc._height) / 2;
perlinBmp = new BitmapData(target_mc._width, target_mc._height);
perlinBmp.perlinNoise(target_mc._width, target_mc._height, 10, Math.round(Math.random() * 100000), false, true, 1, false);
displacementMap = new DisplacementMapFilter(perlinBmp, new Point(0, 0), 1, 1, 100, 100, "color");
shapeClip.filters = [displacementMap];
};
var shapeClip:MovieClip = this.createEmptyMovieClip("shapeClip", 1);
shapeClip.createEmptyMovieClip("holderClip", 1);
var imageLoader:MovieClipLoader = new MovieClipLoader();
imageLoader.addListener(mclListener);
imageLoader.loadClip("http://www.helpexamples.com/flash/images/image1.jpg", shapeClip.holderClip);

var mouseListener:Object = new Object();
mouseListener.onMouseMove = function():Void {
perlinBmp.perlinNoise(shapeClip._width, shapeClip._height, 10, Math.round(Math.random() * 100000), false, true, 1, false);
shapeClip.filters = [displacementMap];
};
Mouse.addListener(mouseListener);

댓글

이 블로그의 인기 게시물

jboss AS 7.1에서 404에러 페이지 설정하기

CentOS 7 인터넷 연결하기

MacOSX에서 MongoDB 설치&환경설정