You are previewing Away3D 3.6 Cookbook.
O'Reilly logo
Away3D 3.6 Cookbook

Book Description

Over 80 practical recipes for creating stunning graphics and effects with the fascinating Away3D engine

  • Invaluable tips and techniques to take your Away 3D applications to the top

  • Reveals the secrets of cleaning your scene from z-sorting artifacts without killing your CPU

  • Get 2D objects into the 3D world by learning to work with TextField3D and extracting graphics from vector graphics

  • Learn essential topics like collision detection, elevation reading, terrain generation, skyboxes, and much more

  • Gain an exclusive and practical introduction to Molehill, the next generation of 3D APIs for the Flash platform - by creating a rotating sphere from scratch.

  • Part of Packt's Cookbook series: each recipe is a carefully organized sequence of instructions to complete the task as efficiently as possible

In Detail

Three dimensions are better than two—and it's not a secret anymore that 3D is here to stay. Gone are the days when Flash was just used for 2D animations. In the last few years online Flash content has undergone a revolution with the introduction of real-time 3D engines for Flash. Away3D is the big daddy of them all—which makes it the ultimate resource for top-rated 3D content development and for powering today's coolest games and Flash sites. Away 3D 3.6 Cookbook is your answer to learning all you need to take your Flash or Away3D skills to the next level— and having fun doing it.

This book is your practical companion that will teach you more than just the essentials of Away3D, and will provide you with all the tools and techniques you need to create a stunning 3D experience. You will find recipes targeting every possible field related to Away3D, 3D development pipelines, and best practices in general. You will find practically relevant content exploring advanced topics, which will clear your way to developing cutting edge applications—not to mention saving hours of searching for help on the internet.

The recipes in this book will teach you diverse aspects of 3D application development with Away3D. They will guide you through essential aspects like creation of assets in external programs and their integration into Away3D, working with material, animation, interactivity, special effects, and much more. Each topic is packed with recipes targeting different levels of complexity so that even experienced Away3D developers will find a lot of useful and unique information.

By the time you are done with this book, you'll be creating your own awesome Away 3D applications and games in less time than you can say ""design"".

Table of Contents

  1. Away3D 3.6 Cookbook
    1. Away3D 3.6 Cookbook
    2. Credits
    3. About the Author
    4. Acknowledgement
    5. About the Reviewers
    6. www.PacktPub.com
      1. Support files, eBooks, discount offers and more
        1. Why Subscribe?
        2. Free Access for Packt account holders
    7. Preface
      1. What this book covers
      2. What you need for this book
      3. Who this book is for
      4. Conventions
      5. Reader feedback
      6. Customer support
      7. Downloading the example code for this book
        1. Errata
        2. Piracy
        3. Questions
    8. 1. Working with Away3D Materials
      1. Introduction
      2. Using a single MovieClip for multiple materials
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
      3. Controlling the MovieClip of MovieMaterial
        1. Getting ready
        2. How to do it...
        3. How it works...
      4. Streaming VOD from FMS for VideoMaterial
        1. Getting ready
        2. How to do it...
        3. How it works...
      5. Interpolating material color dynamically with DepthBitmapMaterial
        1. Getting ready
        2. How to do it...
        3. How it works...
      6. Creating normal maps in Photoshop
        1. Getting ready
        2. How to do it...
      7. Generating normal maps using Away3D NormalMapGenerator
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more…
          1. Generating a normal map using the NormalBumpMaker utility
        5. See also
      8. Getting your hands dirty with Pixel Bender materials
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
          1. Exploring Fresnel Shader
      9. Assembling composite materials
        1. Getting ready
        2. How to do it...
        3. How it works...
    9. 2. Working with Away3D Cameras
      1. Introduction
      2. Creating an FPS controller
        1. Getting ready
        2. How to do it...
        3. How it works...
      3. Creating Camera Depth of Field Effect
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
          1. Creating DOF on Mesh Objects
      4. Detecting whether an object is in front of or behind the camera
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
      5. Changing lenses
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
      6. Following a third-person view with a spring camera
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
      7. Tracking screen coordinates of 3D objects
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
        5. See also
      8. Transforming objects in 3D space relative to the camera position
        1. Getting ready
        2. How to do it...
        3. How it works...
      9. Using Quaternion camera transformations for advanced image gallery viewing
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. See also
    10. 3. Animating the 3D World
      1. Introduction
      2. Animating (Rigging) characters in 3DsMax
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
        5. See also
      3. Controlling bones animation in Collada
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. See also
      4. Working with MD2 animations
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. See also
      5. Morphing objects
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. See also
      6. Animating geometry with Tween engines
        1. Getting ready
        2. How to do it...
        3. How it works...
      7. Moving an object on top of the geometry with FaceLink
        1. Getting ready
        2. How to do it...
        3. How it works...
    11. 4. Fun by Adding Interactivity
      1. Introduction
      2. Adding rotational interactivity to an Away3D primitive by using Mouse movements
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
        5. See also
      3. Implementing advanced object rotation using vector math
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. See also
      4. Creating advanced spherical surface transitions with Quaternions
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
        5. See also
      5. Interactively painting on the model's texture
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
        5. See also
      6. Dragging on geometry by unprojecting mouse coordinates
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. See also
      7. Morphing mesh interactively
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. See also
      8. Creating a controllable non-physical car
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. See also
    12. 5. Experiencing the Wonders of Special Effects
      1. Introduction
      2. Exploding geometry
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
        5. Getting ready
        6. How to do it...
        7. How it works...
        8. See also
      3. Creating advanced bitmap effects using filters
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. See also
      4. Creating clouds
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. See also
      5. Visualizing sound in 3D
        1. Getting ready
        2. How to do it…
        3. How it works...
        4. There's more...
      6. Creating lens flair effects
        1. Getting ready
        2. How to do it…
        3. How it works...
        4. There's more...
      7. Masking 3D objects
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
    13. 6. Using Text and 2D Graphics to Amaze
      1. Introduction
      2. Setting dynamic text with TextField3D
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
      3. Interactive animation of text along a path
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. See also
      4. Creating 3D objects from 2D vector data
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
      5. Drawing with segments in 3D
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
        5. See also
      6. Creating a 3D illusion with Away3D sprites
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. See also
    14. 7. Depth-sorting and Artifacts Solutions
      1. Introduction
      2. Fixing geometry artifacts with Frustum and NearField clipping
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more…
      3. Removing artifacts from intersecting objects
        1. Getting ready
        2. How to do it...
        3. How it works...
      4. Solving depth-sorting problems with Layers and Render Modes
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more…
          1. Z-Sorting using QuadrantRenderer
    15. 8. Prefab3D
      1. Introduction
      2. Exporting models from Prefab
        1. Getting ready
        2. How to do it…
        3. How it works...
        4. There's more...
        5. See also
      3. Normal mapping with Prefab
        1. Getting ready
        2. How to do it…
        3. How it works...
        4. See also
      4. Maintaining workflow with AwayConnector
        1. Getting ready
        2. How to do it…
        3. How it works...
      5. UV map editing with Prefab
        1. Getting ready
        2. How to do it…
        3. How it works...
      6. Creating terrain
        1. Getting ready
        2. How to do it…
        3. How it works...
        4. See also
      7. Generating light maps
        1. Getting ready
        2. How to do it…
          1. There's more...
        3. Creating and animating paths
          1. Getting ready
          2. How to do it…
            1. How it works...
            2. There's more...
    16. 9. Working with External Assets
      1. Introduction
      2. Exporting models from 3DsMax/Maya/Blender
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
        5. See also
      3. Exporting models from 3DsMax to ActionScript class
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
      4. Preparing MD2 models for Away3D in MilkShape
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
        5. See also
      5. Loading and parsing models (DAE, 3ds, Obj, MD2)
        1. Getting ready
        2. How to do it...
        3. How it works…
        4. There's more...
      6. Storing and accessing external assets in SWF
        1. Getting ready
        2. How to do it…
        3. How it works…
        4. See also
      7. Preloading 3D scene assets
        1. Getting ready
        2. How to do it...
        3. How it works…
        4. There's more...
        5. There's more
    17. 10. Integration with Open Source Libraries
      1. Introduction
      2. Setting Away3D with JigLib
        1. Getting ready
        2. How to do it…
        3. How it works…
        4. See also
      3. Creating a physical car with JigLib
        1. Getting ready
        2. How to do it…
        3. How it works…
        4. See also
      4. Morphing Away3D geometry with AS3DMOD
        1. Getting ready
        2. How to do it...
        3. How it works…
        4. See also
      5. Exploding particles with FLINT
        1. Getting ready
        2. How to do it…
        3. How it works…
        4. See also
      6. Setting Augmented Realty with FLARToolkit in Away3D
        1. Getting ready
        2. How to do it...
        3. How it works...
      7. Adding Box2D physics to Away3D objects
        1. Getting ready
        2. How to do it…
        3. How it works…
        4. There's more...
    18. 11. Away3D Lite
      1. Introduction
      2. Setting up Away3D Lite using templates
        1. Getting ready
        2. How to do it...
        3. How it works...
      3. Importing external models in Away3D Lite
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
      4. Manipulating geometry
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
      5. Making 2D shapes appear three dimensional by using Sprite3D
        1. Getting ready
        2. How to do it...
        3. How it works...
      6. Managing Z-Sorting by automatic sorting and using layers
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
          1. Sorting using layers
      7. Creating virtual trackball
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
      8. Writing Away3D Lite applications with haXe
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
    19. 12. Optimizing Performance
      1. Introduction
      2. Defining depth of rendering
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. See also
      3. Restricting the scene poly count
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. See also
      4. Working with LOD objects
        1. Getting ready
        2. How to do it...
        3. How it works...
      5. Optimizing geometry by welding vertices
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
        5. See also
      6. Excluding objects from rendering
        1. Getting ready
        2. How to do it...
        3. How it works...
      7. Image size consideration
        1. Getting ready
        2. How to do it...
        3. How it works...
      8. Important tips for performance optimization
    20. 13. Doing More with Away3D
      1. Introduction
      2. Moving on uneven surfaces
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. See also
      3. Detecting collisions between objects in Away3D
        1. Getting ready
        2. How to do it...
          1. AABB test:
        3. How it works...
        4. There's more...
          1. AABS test
          2. Ray — AABS intersection test
          3. Ray Triangle test
        5. See also
      4. Creating cool effects with animated normal maps
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. See also
      5. Creating skyboxes and their textures
        1. Getting ready
        2. How to do it...
        3. Creating a SkyBox6-compatible texture
        4. Skybox setup in Away3D
        5. How it works...
      6. Running heavy scenes faster using BSP trees
        1. Getting ready
        2. How to do it...
          1. How it works...
    21. A. Beginning Molehill API
      1. Creating a rotating sphere from scratch
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
          1. Compacting the matrix operations
        5. See also