# Some Help With PerlinNoise

**URL:** https://forum.kirupa.com/t/some-help-with-perlinnoise/247277
**Category:** flash
**Created:** [December 20, 2007, 3:38pm UTC](https://forum.kirupa.com/t/some-help-with-perlinnoise/247277 "2007-12-20T15:38:05Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![gphilly77](https://avatars.discourse-cdn.com/v4/letter/g/5e9695/32.png) [@gphilly77](https://forum.kirupa.com/u/gphilly77)
#### Post date: [December 20, 2007, 3:38pm UTC](https://forum.kirupa.com/t/some-help-with-perlinnoise/247277/1 "2007-12-20T15:38:05Z")

</div>

[http://www.flepstudio.org/forum/tutorials/629-actionscript-3-0-perlinnoise-method.html](http://www.flepstudio.org/forum/tutorials/629-actionscript-3-0-perlinnoise-method.html)

I found the tut above and really enjoyed since I was a bit tired of using the old style of cloud animation MoveClips.

I am wondering what input would be on the best way to convert this into code that generates basically a blue sky w/ white clouds, more of a daytime scene than nighttime.

I started playing around w/ ColorTransform & ColorMatrixFilters, but really haven’t been able to achieve the desired effect.

See below:

function initClouds():void {

bt=new BitmapData(stage.width-11,120,true,0xFFFFFF);  
img = new Bitmap(bt);  
img.x = 6;  
img.y = 6;

addChildAt(img,17);  
addEventListener(Event.ENTER\_FRAME,onEnterFrame);  
}

function onEnterFrame(event:Event):void{  
var matrix:Array = new Array();  
matrix = matrix.concat([0, 0, 0, 0, 0]); // red  
matrix = matrix.concat([0, 0, 0, 0, 0]); // green  
matrix = matrix.concat([0, 0, 0, .6, 0]); // blue  
matrix = matrix.concat([0, 0, 0, 1, 0]); // alpha

var filter:ColorMatrixFilter = new ColorMatrixFilter(matrix);  
var filters:Array = new Array();  
filters.push(filter);

var point:Point=new Point(this.\_offset,50);  
var channels:uint = BitmapDataChannel.ALPHA;

bt.perlinNoise(300,100,2,1000,false,true,channels, false,[point,point]);  
img.filters = filters;  
}

I really want to lighten up the blue in the matrix incorporate some kinda of gradient w/ the bitmap so the “clouds” that are generated are rather faded from the bottom up. As can be seen in the screen shot below, I do’nt want the clouds on top of the mountains.

Thanks alot

GP
