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

Moving on uneven surfaces

If you work on an application such as a First Person Shooter (FPS), the chances are high that you would need your character to move not only on perfectly horizontal surfaces, but also on an elevated terrain. Away3D has got a cool utility exactly for this purpose called ElevationReader, which allows you to get the pixel data of a specific coordinate on the height map and convert it into the elevation (Y) coordinate value. In this recipe, you will learn how to set up FPS moving on uneven terrain using ElevationReader.

Getting ready

  1. Create a new class which extends AwayTemplate and name it ElevationReaderDemo.
  2. In this example, we make use of GUI controls which are part of a Flash components library developed by Keith Peters ...

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