You are previewing The Essential Guide to 3D in Flash.
O'Reilly logo
The Essential Guide to 3D in Flash

Book Description

If you are an ActionScript developer or designer and you would like to work with 3D in Flash, this book is for you. You will learn the core Flash 3D concepts, using the open source Away3D engine as a primary tool. Once you have mastered these skills, you will be able to realize the possibilities that the available Flash 3D engines, languages, and technologies have to offer you with Flash and 3D.

  • Describes 3D concepts in theory and their implementation using Away3D

  • Dives right in to show readers how to quickly create an interactive, animated 3D scene, and builds on that experience throughout the book

  • Each chapter contains a number of tutorials that focus on one specific feature or group of features

Table of Contents

  1. Copyright
  2. About the Author
  3. About the Technical Reviewer
  4. Acknowledgments
  5. Introduction
    1. Layout conventions
  6. 1. Getting Started
    1. 1.1. Getting the Away3D library
    2. 1.2. Setting up a project
      1. 1.2.1. Using Adobe Flash CS4/CS5
      2. 1.2.2. Using Flash Builder
      3. 1.2.3. Using FDT
      4. 1.2.4. Using FlashDevelop
      5. 1.2.5. Open source workflow using the Flex SDK and Makefiles
    3. 1.3. Summary
  7. 2. Creating Your First 3D Project
    1. 2.1. Starting up the engine
    2. 2.2. Adding 3D objects to the scene
      1. 2.2.1. Understanding constructors and initialization objects
    3. 2.3. Lighting the scene
    4. 2.4. Animating objects in 3D
    5. 2.5. Enabling interactivity in 3D
    6. 2.6. Summary
  8. 3. The View, Scene, and Camera
    1. 3.1. Understanding the basics
      1. 3.1.1. View
      2. 3.1.2. Scene
      3. 3.1.3. Camera
    2. 3.2. Exploring the fundamentals of 3D
      1. 3.2.1. Working with coordinates in 3D space
      2. 3.2.2. The rendering process
        1. 3.2.2.1. Clipping
        2. 3.2.2.2. Z sorting
        3. 3.2.2.3. Perspective Projection
    3. 3.3. Setting up the chapter base class
    4. 3.4. Creating and using the view
      1. 3.4.1. Centering the vanishing point
      2. 3.4.2. Clipping the viewport
    5. 3.5. Managing the scene
      1. 3.5.1. Adding and removing 3D objects
      2. 3.5.2. Accessing 3D objects in the scene
      3. 3.5.3. Working with nested 3D objects
      4. 3.5.4. Moving, rotating, and scaling in 3D
      5. 3.5.5. Using containers as pivots
    6. 3.6. Creating and using cameras
      1. 3.6.1. The Camera3D object
        1. 3.6.1.1. Moving the camera
        2. 3.6.1.2. Rotating the camera
        3. 3.6.1.3. Adjusting the zoom and focus properties
        4. 3.6.1.4. Aiming at objects using lookAt()
      2. 3.6.2. The TargetCamera3D object
      3. 3.6.3. The HoverCamera3D object
    7. 3.7. Summary
  9. 4. Primitives, Models, and Sprites
    1. 4.1. Knowing the basic terminology
      1. 4.1.1. Vertices
      2. 4.1.2. Faces and segments
      3. 4.1.3. Meshes and primitives
      4. 4.1.4. Billboards and sprites
    2. 4.2. Setting up this chapter's base class
    3. 4.3. Understanding common primitives
      1. 4.3.1. The plane primitive
      2. 4.3.2. Back-face culling
      3. 4.3.3. The cube primitive
      4. 4.3.4. The sphere primitive
    4. 4.4. Understanding wire primitives and line segments
      1. 4.4.1. Wireframe primitives
      2. 4.4.2. Combining wireframe and regular primitives
      3. 4.4.3. Drawing irregular lines in space
    5. 4.5. Using regular polygons
    6. 4.6. Working with external models
      1. 4.6.1. Workflow when loading a model
    7. 4.7. Optimizing external resources for size and speed
      1. 4.7.1. Converting a model to ActionScript
      2. 4.7.2. Using the converted model
      3. 4.7.3. Creating a library of models
    8. 4.8. Applying bitmap filter effects to 3D objects
    9. 4.9. Using 3D sprites
      1. 4.9.1. Creating smoke using 3D sprites
    10. 4.10. Tutorial: Creating a twisted image gallery
      1. 4.10.1. Laying out the application shell
      2. 4.10.2. Creating the TV sets
      3. 4.10.3. Loading the gallery image
      4. 4.10.4. Creating the menu items
      5. 4.10.5. Displaying the content
      6. 4.10.6. Adding movement and interactivity
    11. 4.11. Summary
  10. 5. Materials, Lights, and Shading
    1. 5.1. Understanding Away3D materials
    2. 5.2. Using color and bitmap materials
    3. 5.3. Working with wire materials
    4. 5.4. Using lights and shading materials
      1. 5.4.1. Lighting in Away3D
        1. 5.4.1.1. Omnidirectional lighting with point lights
        2. 5.4.1.2. Parallel beam lighting with directional lights
        3. 5.4.1.3. Background lighting with AmbientLight3D
      2. 5.4.2. Creating and configuring light sources
      3. 5.4.3. Controlling the intensity of a light source
      4. 5.4.4. Shading materials in Away3D
        1. 5.4.4.1. Flat shading materials
      5. 5.4.5. Using normal map shading
        1. 5.4.5.1. Generating a normal map
        2. 5.4.5.2. Using DOT3 materials in Away3D
      6. 5.4.6. Using environment shading
    5. 5.5. Using animated and interactive materials
      1. 5.5.1. Using the MovieMaterial class
      2. 5.5.2. Using the VideoMaterial class
    6. 5.6. Summary
  11. 6. Vector Shapes and Text in 3D
    1. 6.1. Working with vector graphics
      1. 6.1.1. Vector graphics vs. raster graphics
      2. 6.1.2. Creating lines and curves
      3. 6.1.3. Using the Away3D drawing API
    2. 6.2. Preparing the chapter base class
    3. 6.3. Drawing 3D vector shapes
      1. 6.3.1. Creating simple shapes with straight lines
      2. 6.3.2. Creating curved shapes
      3. 6.3.3. Creating open-ended line segments
      4. 6.3.4. Creating nonplaner shapes
      5. 6.3.5. Creating shapes with holes
    4. 6.4. Importing 3D vector shapes
      1. 6.4.1. Extracting vector shapes from an SWF file
      2. 6.4.2. Animating imported vector shapes
    5. 6.5. Importing 3D Text
      1. 6.5.1. Extracting vector data from a font
      2. 6.5.2. Extruding text
      3. 6.5.3. Warping text along a path
    6. 6.6. Knowing the limitations of vector graphics in Away3D
    7. 6.7. Summary
  12. 7. Procedural 3D content
    1. 7.1. Preparing the chapter base class
    2. 7.2. Building a pyramid primitive
      1. 7.2.1. Starting with AbstractPrimitive
      2. 7.2.2. Setting up the constructor
      3. 7.2.3. Adding public properties
      4. 7.2.4. Building the Pyramid mesh
      5. 7.2.5. Mapping UV coordinates
    3. 7.3. Using the extrusions tools
      1. 7.3.1. Creating a ribbon using the PathExtrusion class
      2. 7.3.2. Creating a vase with the LatheExtrusion class
    4. 7.4. Using mesh modifiers
      1. 7.4.1. Creating a terrain using the HeightMapModifier
    5. 7.5. Summary
  13. 8. Interactivity
    1. 8.1. Setting up the chapter base class
    2. 8.2. Interacting with 3D objects in a scene
      1. 8.2.1. Introducing the MouseEvent3D object
      2. 8.2.2. Using MouseEvent3D's scene coordinates
      3. 8.2.3. Using MouseEvent3D's UV coordinates
    3. 8.3. First-person camera keyboard controls
      1. 8.3.1. Walking with the keyboard
      2. 8.3.2. Looking around by dragging the mouse
        1. 8.3.2.1. Looking around by scrubbing the mouse
    4. 8.4. Summary
  14. 9. Animation
    1. 9.1. The basics of scripted animation
    2. 9.2. Using basic tweening
    3. 9.3. Path tweening
    4. 9.4. Importing animation
      1. 9.4.1. Working with MD2 animations
        1. 9.4.1.1. Importing an MD2 file
        2. 9.4.1.2. Playing an MD2 animation
      2. 9.4.2. Working with COLLADA animations
        1. 9.4.2.1. Importing a COLLADA file
        2. 9.4.2.2. Playing a COLLADA animation
    5. 9.5. Creating programmatic animation with bones
      1. 9.5.1. Defining an animation rig
      2. 9.5.2. Bone tweening
    6. 9.6. Summary
  15. 10. Optimizing Tips and Tricks
    1. 10.1. Preparing the chapter base class
    2. 10.2. Optimizing geometry
      1. 10.2.1. Using level-of-detail objects
      2. 10.2.2. Culling and clipping polygons and meshes
        1. 10.2.2.1. Back-face culling
        2. 10.2.2.2. Viewport clipping
        3. 10.2.2.3. Object culling
        4. 10.2.2.4. Manual culling
      3. 10.2.3. Using models effectively
        1. 10.2.3.1. Polygon counts
        2. 10.2.3.2. Intersecting polygons
        3. 10.2.3.3. Double-sided geometry
    3. 10.3. Optimizing materials
      1. 10.3.1. Optimizing shading
        1. 10.3.1.1. Static shading
        2. 10.3.1.2. Normal map images
      2. 10.3.2. Conserving material instances
    4. 10.4. Exploring general best practice techniques
      1. 10.4.1. Switching between 3D coordinate systems
        1. 10.4.1.1. Converting from object space to scene space
        2. 10.4.1.2. Converting from scene space to object space
        3. 10.4.1.3. Converting from object space to screen space
      2. 10.4.2. Changing camera lenses
        1. 10.4.2.1. Traditional perspective projections
        2. 10.4.2.2. Extreme wide-angle projections
        3. 10.4.2.3. Isometric projections
    5. 10.5. Summary