O'Reilly logo

Away3D 3.6 Cookbook by Michael Ivanov

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating clouds

In this recipe, you are going to learn how to generate quite realistic clouds in Away3D. In fact, we will create fake 3D clouds which, in essence, are procedural perlin noise rendered to textures of several plane primitives, positioned in front of each other at some distance. The result is pretty convincing and not too CPU intensive.

Getting ready

Set up a basic Away3D scene extending AwayTemplate and you are good to go.

How to do it...

Use the following code for PerlinClouds.as:

package { public class PerlinClouds extends AwayTemplate { private var _planes:Array=[]; private var _numberOfPlanes:int=6; private var _perlin3D:Array=[]; private var _plane:Plane; private var _planeSize:int=700; private var _offsets:Array; private var _colTransform:ColorTransform=new ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required