connectedpixel.com

actionscript, web development

Tutorials

Flash8 Perlin Marble Texture

Submitted by joelmay on 8 November, 2005 - 2:25pm.

Last week, I wrote an article about using Flash 8 Perlin noise to generate a wood texture. Today, it's marble.

According to this link, the Perlin formula for marble is:

texture = cosine( x + perlin(x,y,z) )

Again, we don't want to do math on every pixel -- too slow. So, how do we do this with the existing Flash 8 API? First, let's pretend that the perlin term in the above equation is not there. Here's what our image would look like (this image is arbitrarily blue monochrome):

Flash8 Perlin Wood Texture

Submitted by joelmay on 1 November, 2005 - 12:36pm.

The Flash 8 documentation for perlinNoise() has this intriguing statement:

You can use Perlin noise functions to simulate natural phenomena and landscapes, such as wood grain, clouds, and mountain ranges.

OK. That sounds like fun. But how is this done? It's not immediately obvious, at least not to me. So I googled .

According to these links (here and here), the formula for wood is:

g = perlin(x,y) * 20;
grain = g - int(g);

Chicago MMUG Presentation tonight: Flash Components

Submitted by joelmay on 17 October, 2005 - 10:28am.

Tonight (Oct 17), downtown Chicago, we're having a Flash-component tutorial party. We will learn:

  • How to use them
  • Where to get them
  • Why they're so great
  • And even (gasp!) how to make them (!!!)

As a special bonus, there will be gratuitous drop-shadows and blends so we can make a big deal about using Flash 8.

If you left Chicago to go to MAX, you made a mistake (yes you, Michael Schaffner). Quick, get on the plane and get back here!

XML feed