Advertising
- Someone
- 2012 year 7 month 15 day Sunday 15:12:09 MDT
- // you need three bitmaps in the library: stone, koala, and koalabg
- var bm = new BitmapData(625,515,true,0);
- var bm2 = bm.clone();
- var bm3 = bm.clone();
- var stones = [];
- var stone_count = 8;
- for (i = 0; i<stone_count; i++) {
- o = {};
- stones.push(o);
- o.x = (Math.random()*32 - 16) + 625*(i + .5)/stone_count;
- o.y = 515 + Math.random()*515;
- o.r = Math.random()*2*Math.PI;
- o.sc = 1 + Math.random();
- }
- var stn = new stone();
- function getFrameAtProgress (pg) {
- bm.draw(new koalabg());
- bm3.fillRect(bm3.rect,0);
- var pbm:BitmapData = new BitmapData(625,64,true,0);
- pbm.perlinNoise(28, 28, 5, 696969420, true, true, 7, false);
- for (var yy = 525 + pbm.height; yy >= -pbm.height; yy -= pbm.height) {
- mtx = new Matrix();
- mtx.translate(0, Math.floor(yy - pg*pbm.height));
- bm3.draw(pbm,mtx);
- }
- var dfl:DisplacementMapFilter = new DisplacementMapFilter(bm3, new Point(), 2, 4, 45, 80, "clamp");
- bm2.fillRect(bm2.rect,0);
- bm2.draw(new koala());
- bm.applyFilter(bm, bm.rect, new Point(), dfl);
- ctf = new ColorTransform(1,1,1,.5,0,0,0,0);
- bm.draw(new koalabg(),null,ctf);
- bm.draw(bm2);
- for (var i = stones.length-1; i>=0; i--) {
- var o = stones[i];
- for (var j = 1525; j>=-300; j-=Math.pow(o.sc,2)*180) {
- mtx = new Matrix();
- mtx.translate(-stn.width/2, -stn.height/2);
- mtx.rotate(o.r + 2*Math.PI*pg);
- mtx.translate(stn.width/2, stn.height/2);
- var sc = .1*Math.pow(o.sc,2);
- mtx.scale(sc, sc);
- mtx.translate(o.x, o.y - (j + pg*Math.pow(o.sc,2)*180));
- bm2.fillRect(bm2.rect,0);
- bm2.draw(stn, mtx, null, null, null, true);
- var bsc = Math.pow(o.sc, 5);
- if (bsc <= 2) {
- bsc = 2;
- }
- var fl = new BlurFilter(bsc, bsc, 2);
- bm2.applyFilter(bm2, bm2.rect, new Point(), fl);
- bm.draw(bm2);
- }
- }
- return bm;
- }
advertising
Update the Post
Either update this post and resubmit it with changes, or make a new post.
You may also comment on this post.
Please note that information posted here will expire by default in one month. If you do not want it to expire, please set the expiry time above. If it is set to expire, web search engines will not be allowed to index it prior to it expiring. Items that are not marked to expire will be indexable by search engines. Be careful with your passwords. All illegal activities will be reported and any information will be handed over to the authorities, so be good.