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

Book Description

Take Flash to the next dimension by creating detailed, animated, and interactive 3D worlds with Away3D

  • Create stunning 3D environments with highly detailed textures

  • Animate and transform all types of 3D objects, including 3D Text

  • Eliminate the need for expensive hardware with proven Away3D optimization techniques, without compromising on visual appeal

  • Written in a practical and illustrative style, which will appeal to Away3D beginners and Flash developers alike

In Detail

Away3D is one of the most popular real-time 3D engines for Flash. Besides creating various detailed 3D environments you can also create animated 3D scenes, use various special effects, integrate third-party libraries, and much more. The possibilities of using this engine are endless. But will you be able take full advantage of all these features and make a 3D application that is picture perfect?

This is the best book for guiding you through Away3D, and the possibilities it opens up for the Flash platform. You'll be able to create basic 3D objects, display lifelike animated characters, construct complex 3D scenes in stunning detail, and much more with this practical hands-on guide.

Starting with the very basics, this book will walk you through creating your first Away3D application, and then move on to describe and demonstrate the many features that are available within Away3D such as lighting, shading, animation, 3D text, model loading and more. With the help of this comprehensive guide to all the information you ever needed to use Away3D, you'll find yourself creating incredibly detailed 3D environments in no time.

You begin with an overview of downloading the Away3D source code and configuring various authoring tools like Flex Builder, Flash Builder, FlashDevelop, and Flash CS4. Next you ease your way through creating your first primitive 3D object from scratch, then move on to creating stunning 3D environments with incredibly detailed textures and animations. You will make applications react to mouse events, with the click of a mouse – literally, learn ways to focus your camera and perfect your creation by viewing it from all angles, and take your Away3D application to the next level by overcoming the limitations in default Away3D algorithms. You will also learn optimization techniques to obtain the best performance from Away3D, without compromising on visual appeal.

Create stunning real-world 3D Flash applications, right from displaying your first sphere to creating entire 3D cities, with plenty of tips to help you avoid common pitfalls

Table of Contents

  1. Away3D 3.6 Essentials
    1. Table of Contents
    2. Away3D 3.6 Essentials
    3. Credits
    4. About the Author
    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
        1. Errata
        2. Piracy
        3. Questions
    8. 1. Building Your First Away3D Application
      1. Choosing between Away3D for Flash Player 9 or Flash Player 10
      2. Downloading Away3D
        1. Downloading the source ZIP file
        2. Downloading the source using SVN
          1. Using TortoiseSVN
      3. Creating an empty project for Away3D
        1. Adobe Flex Builder or Flash Builder
        2. FlashDevelop
        3. Adobe Flash CS4
      4. Targeting the Flash Player 10 runtime
        1. Adobe Flex Builder and Adobe Flash Builder
        2. FlashDevelop
        3. Adobe Flash CS4
      5. Creating the initial application
      6. Running Away3DTemplate
        1. Adobe Flex Builder and Adobe Flash Builder
        2. FlashDevelop
        3. Adobe Flash CS4
        4. The end result
      7. Positioning objects in a 3D scene
      8. Extending Away3DTemplate to populate the scene
      9. Running SphereDemo
        1. Adobe Flex and Adobe Flash Builder
        2. FlashDevelop
        3. Adobe Flash CS4
        4. The end result
      10. Summary
    9. 2. Creating and Displaying Primitives
      1. The basic elements of a 3D object
        1. Vertices
        2. Triangle faces
        3. Sprite3D
        4. Segments
      2. UV coordinates
      3. Creating primitive 3D objects
        1. Common init object properties
        2. Cone
        3. Cube
        4. Cylinder
        5. Geodesic sphere
        6. Grid plane
        7. LineSegment
        8. Plane
        9. RegularPolygon
        10. RoundedCube
        11. SeaTurtle
        12. Skybox
        13. Skybox6
        14. Sphere
        15. Torus
        16. Triangle
        17. Trident
      4. Summary
    10. 3. Moving Objects
      1. Global, parent, and local coordinate systems
        1. World space
        2. Parent space
        3. Local space
      2. Transformation functions / properties and their coordinate systems
      3. Modifying position
        1. The x, y, and z properties
        2. The position property
        3. The move functions
        4. The moveTo() function
          1. The translate() function
      4. Modifying rotation
        1. The rotation init object parameters
        2. The rotation properties
        3. The rotateTo() function
        4. The eulers property
        5. The rotate() function
        6. The lookAt() function
        7. The pivotPoint property
        8. The movePivot() function
        9. The scenePivotPoint property
        10. The pitch(), roll(), and yaw() functions
      5. Modifying scale
        1. The scale init object parameter
        2. The scale() function
        3. The scaleX, scaleY, and scaleZ properties
      6. Modifying the transform
      7. Tweening
      8. Nesting
      9. Summary
    11. 4. Z-Sorting
      1. The painter's algorithm
      2. Sorting the scene
      3. Adjusting the sorting order
        1. The pushfront and pushback properties
        2. The screenZOffset property
        3. The ownCanvas property
      4. A note about Z-Sorting
      5. Additional renderers
      6. Summary
    12. 5. Materials
      1. The difference between textures and materials
      2. Resource management
      3. Defining colors in Away3D
        1. By integer
        2. By string
      4. Pixel Bender
      5. Lights and materials
      6. Shading techniques
        1. Texture mapping
        2. Normal mapping
        3. Environment mapping
        4. Flat shading
        5. Phong shading
      7. Applying materials
        1. Basic materials
          1. WireColorMaterial
          2. WireframeMaterial
          3. ColorMaterial
        2. Bitmap materials
          1. BitmapMaterial
          2. TransformBitmapMaterial
        3. Animated materials
          1. MovieMaterial
          2. AnimatedBitmapMaterial
          3. Interactive MovieMaterial
        4. Composite materials
          1. DepthBitmapMaterial
          2. EnviroBitmapMaterial
          3. EnviroColorMaterial
        5. Light materials
          1. WhiteShadingBitmapMaterial
          2. ShadingColorMaterial
          3. PhongBitmapMaterial
          4. PhongColorMaterial
          5. PhongMovieMaterial
          6. Dot3BitmapMaterial
        6. Pixel Bender materials
          1. Dot3BitmapMaterialF10
          2. PhongPBMaterial
          3. PhongMultiPassMaterial
          4. FresnelPBMaterial
          5. CubicEnvMapPBMaterial
      8. Loading textures from external files
        1. BitmapFileMaterial
        2. Using the TextureLoadQueue
      9. Summary
    13. 6. Models and Animations
      1. 3D formats supported by Away3D
        1. Exporting 3D models
          1. Exporting from 3ds Max
          2. Exporting from MilkShape
          3. Exporting from Sketch-Up
          4. Exporting from Blender
          5. A note about the Collada exporters
      2. Loading a 3D model
        1. Animated models
          1. MD2—Loading an embedded file
            1. MD2—Loading an external file
            2. Collada—Loading an embedded file
            3. Collada—Loading an external file
            4. AS—Loading a converted model
          2. Static models
            1. 3DS—Loading an embedded file
            2. 3DS—Loading an external file
            3. AWD—Loading an embedded file
            4. AWD—Loading an external file
            5. KMZ
            6. ASE—Loading an embedded file
            7. ASE—Loading an external file
            8. OBJ—Loading an embedded file
            9. OBJ—Loading an external file
        2. The problem with init and Init objects
        3. Converting a loaded model to an ActionScript class
        4. Summary
    14. 7. Cameras
      1. The properties of a camera
      2. Camera lenses
        1. ZoomFocusLens and PerspectiveLens classes
        2. SphericalLens class
        3. OrthogonalLens class
      3. Camera classes
        1. Target camera
        2. Hover camera
        3. Spring camera
      4. Summary
    15. 8. Mouse Interactivity
      1. Away3D mouse events
      2. The difference between ROLL_OVER / ROLL_OUT and MOUSE_OVER / MOUSE_OUT
      3. Projecting the mouse position into the scene
      4. Summary
    16. 9. Special Effects with Sprites
      1. Using the Sprite3D class
      2. Using the DirectionalSprite class
      3. Using the DepthOfFieldSprite class
      4. Using a particle system
        1. Creating the Away3D Stardust initializer
        2. Creating the Away3D Stardust particle renderer
        3. Creating the Stardust emitter
        4. Putting it all together
      5. Summary
    17. 10. Creating 3D Text
      1. Embedding fonts
      2. Displaying text in the scene
      3. 3D Text materials
      4. Extruding 3D text
      5. Warping 3D text
      6. Summary
    18. 11. Extrusions and Modifiers
      1. Creating a flag with the PathExtrusion class
      2. Creating walls with the LinearExtrusion class
      3. Creating a vase with the LatheExtrusion class
      4. Creating terrain with the SkinExtrusion class
      5. Reading the height of a terrain surface with the ElevationReader class
      6. HeightMapModifier
      7. Summary
    19. 12. Filters and Postprocessing Effects
      1. Flash and Away3D filters
        1. The Flash filters
          1. Applying filters
          2. Applying the BlurFilter
          3. Applying the DisplacementMapFilter
          4. Applying the GlowFilter
          5. Applying Pixel Bender shaders
          6. Applying filters to the view
        2. Away3D filters
      2. Render Sessions
        1. Postprocessing with the BitmapRenderSession
      3. Summary
    20. 13. Performance Tips
      1. Determining the current frame rate
      2. Setting the maximum frame rate
      3. Setting Flash quality to low
      4. Reducing the size of the viewport
      5. Scaling the viewport output
      6. Triangle caching
      7. Level of detail models
      8. Away3D filters
        1. ZDepthFilter
        2. MaxPolyFilter
      9. Offscreen rendering
      10. Model formats
      11. Summary
    21. Index