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.
Set up a basic Away3D scene extending AwayTemplate
and you are good to go.
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 ...
No credit card required