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

Generating normal maps using Away3D NormalMapGenerator

Now let's see how we can generate a normal map inside Away3D using the NormalMapGenerator class located in the materials.utils package.

Getting ready

Create a basic Away3D scene using AwayTemplate. Then make sure you load or embed SimpleBitmap1.png and HeightMap.png image files, which are located in this chapter's assets folder.

How to do it...

NormalMapGen.as

package { public class NormalMapGen extends AwayTemplate { [Embed(source="assets/SimpleBitmap1.png")] private var SimpleTexture:Class; [Embed(source="assets/HeightMap.png")] private var HeightMap:Class; private var _normalMap:BitmapData; private var _normThumb:Bitmap; private var _pointLight:PointLight3D; private var _sp:Sphere; private ...

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