Papervision3D Essentials

Papervision3D Essentials
eBook: $26.99
Formats: PDF, PacktLib, ePub and Mobi formats
save 30%!
Print + free eBook + free PacktLib access to the book: $71.98    Print cover: $44.99
save 37%!
Free Shipping!
UK, US, Europe and selected countries in Asia.
Also available on:
Table of Contents
Sample Chapters
  • Build stunning, interactive Papervision3D applications from scratch
  • Export and import 3D models from Autodesk 3ds Max, SketchUp and Blender to Papervision3D
  • In-depth coverage of important 3D concepts with demo applications, screenshots and example code.
  • Step-by-step guide for beginners and professionals with tips and tricks based on the authors’ practical experience

Book Details

Language : English
Paperback : 428 pages [ 235mm x 191mm ]
Release Date : September 2009
ISBN : 1847195725
ISBN 13 : 9781847195722
Author(s) : Paul Tondeur, Jeff Winder
Topics and Technologies : All Books, Other, Flash, Open Source


Table of Contents

Chapter 1: Setting Up
Chapter 2: Building Your First Application
Chapter 3: Primitives
Chapter 4: Materials
Chapter 5: Cameras
Chapter 6: Moving Things Around
Chapter 7: Shading
Chapter 8: External Models
Chapter 9: Z-Sorting
Chapter 10: Particles
Chapter 11: Filters and Effects
Chapter 12: 3D Vector Drawing and Text
Chapter 13: Optimizing Performance
  • Chapter 1: Setting Up
    • Downloading Papervision3D
      • Difference between compiled and non-compiled source code
      • What is Subversion?
      • What's inside the ZIP?
      • And what's inside the SWC?
      • Choosing between the SWC, the ZIP, and the SVN
    • Downloading the non-compiled source using SVN
      • On Windows
      • On Mac OS X
    • Downloading the non-compiled source in the ZIP file
    • Downloading the compiled source
    • Configuring your authoring tool for Papervision3D
      • Configuring Flash
        • Set the path to the non-compiled source code in Flash (CS3 and CS4)
        • Set the path to the compiled source code in Flash (Only CS4)
        • Running an example in Flash
      • Configuring Flex Builder and Flash Builder
        • Importing an example project
        • Setting the path to the non-compiled source code in Flex and Flash Builder
        • Setting the path to the SWC in Flex and Flash Builder
        • Running the example in Flex Builder and Flash Builder
    • Where to find the Papervision3D documentation
    • Summary
  • Chapter 2: Building Your First Application
    • Introduction to classes and object-oriented programming
      • Creating a custom class
      • Inheritance
    • Working with the Document Class/Main Application File
      • Setting up the document class for Flash
      • Setting up the document class for Flex Builder and Flash Builder
    • Basics of a 3D scene in Papervision3D
      • Scene
      • Camera
      • Viewport
      • 3D Objects
      • Material
      • Render engine
      • Left-handed Cartesian coordinate system
    • Creating a basic class for Papervision3D
      • The basic document class
      • Finalizing your first application
    • Smart programmers use less code
    • Preparing for the book examples
      • Working with the BookExampleTemplate class
    • Summary
  • Chapter 3: Primitives
    • The basic elements of 3D objects
      • Vertices
      • Triangles
    • The rendering pipeline
    • Creating and adding primitives
      • Plane
      • Sphere
      • Cylinder
      • Cone
      • Cube
      • PaperPlane
      • Arrow
    • Nesting
      • World space versus local space
      • Creating a pivot point with DisplayObject3D
    • Accessing vertices
      • Example—building a sphere of spheres
    • Summary
  • Chapter 4: Materials
    • Introduction to materials
      • Basic properties
    • Basic materials
      • Wireframe material
      • Color material
    • Three ways of using bitmaps as a material
      • BitmapMaterial
        • Using a bitmap shape as material that is generated by code
        • Manually loading and assigning an external bitmap as material
      • BitmapFileMaterial
      • BitmapAssetMaterial
    • Two ways of using a movie clip as material
      • MovieMaterial
      • MovieAssetMaterial
    • VideoStreamMaterial
    • Combining materials
    • Interactivity
      • Material interactivity
        • Using ButtonMode
        • Defining the event listeners
      • Object interactivity
    • Tips and tricks
      • Tiling
      • Flipping your material
      • Power of two textures
    • Example—creating a carousel
    • Summary
  • Chapter 5: Cameras
    • Cameras inherit from DisplayObject3D
    • Basic camera settings
      • Focus and field of view
      • Zoom
      • Zoom, focus, and field of view relate to each other
      • Near and far
    • Camera types
      • The target camera
      • The free camera
        • Demonstrating the difference between the free camera and the target camera
        • Switching between the free camera and the target camera
      • The debug camera
      • The spring camera
        • Adding basic navigation
        • Putting the spring camera to work
    • Setting a target with the lookAt() method
    • Culling
      • Types of culling in 3D computer graphics
      • Two levels of culling in Papervision3D
      • Applying frustum culling
      • Applying culling on viewport level
      • Seeing culling at work
    • Clipping
      • Clipping in Papervision3D with FrustumClipping
      • Seeing frustum clipping at work
      • Culling and clipping in the rendering pipeline
    • Summary
  • Chapter 6: Moving Things Around
    • What can we move around?
    • How can we move things around?
    • Rotating objects
      • Alternatives for local rotation—pitch(), yaw(), and roll()
      • Another type of rotation—rotationX, rotationY, and rotationZ
      • Demonstrating the difference between rotation and local rotation
    • Mouse interaction
      • Getting the distance from the mouse to the center of the stage
      • Basic mouse interaction
      • Mouse interaction with easing
      • Using mouse interaction to rotate an object
      • Orbiting the camera around an object
        • Orbiting the camera by moving the mouse
        • Orbiting the camera by dragging the mouse
        • Clamping the camera rotation
    • Animating with Tweener
      • Downloading Tweener
      • Tweening 3D objects
      • Tweening the camera over a curved path
    • Example—the galaxy extended
      • Creating a class for user input
      • Creating a class for the galaxy
      • Creating a class for the paper plane
      • Initializing the application in our document class
      • Controlling the camera
        • Adding dynamic zoom
        • Adding a third-person camera
        • Adding a first-person camera
        • Adding random camera perspectives
        • Switching back to the default view
    • Summary
  • Chapter 7: Shading
    • Introduction to shading
    • Flat shading
      • FlatShadeMaterial for color-based shading
      • FlatShader for bitmap-based shading
    • Gouraud shading
    • Cell shading
    • Phong shading
    • Bumping your materials
    • Reflection mapping
    • Example—shading the Earth in our galaxy
      • Adding a shader and a bump map
    • Summary
  • Chapter 8: External Models
    • Modeling for Papervision3D
      • Keep your polygon count low
      • Add polygons to resolve artifacts
      • Keep your textures small
      • Use textures that Flash can read
      • Use UV maps
      • Baking textures
      • Use recognizable names for objects and materials
      • Size and positioning
      • Finding the balance between quality and performance
    • Creating a template class to load models
    • Creating models in Autodesk 3ds Max and loading them into Papervision3D
      • Installing COLLADA Max
      • Creating the Utah teapot and export it for Papervision3D
      • Importing the Utah teapot into Papervision3D
      • Exporting and importing the Utah teapot in 3ds format
      • Importing animated models
        • Animation clips
    • Creating and loading models using SketchUp
      • Exporting a model from Google's 3D Warehouse for Papervision3D
      • Importing a Google Earth model into Papervision3D
    • Creating and loading models using Blender
      • Exporting a textured cube from Blender into Papervision3D
    • Keeping control over your materials
    • Summary
  • Chapter 9: Z-Sorting
    • What is z-sorting
      • The painter's algorithm
      • Sorting triangles
    • Layering your renders
      • Creating a viewport layer
        • Creating a viewport layer using useOwnContainer
        • Creating and sorting a viewport layer using getChildLayer
        • Creating a viewport layer by instantiating a new ViewportLayer
      • Sorting layers
        • Sorting layers with ViewportLayerSortMode.Z_SORT
        • Sorting layers with ViewportLayerSortMode.ORIGIN_SORT
        • Sorting layers with ViewportLayerSortMode.INDEX_SORT
      • Creating and sorting sublayers
    • Quadtree rendering
    • Summary
  • Chapter 10: Particles
    • What particles are and why to use them
      • Billboarding
      • Particle systems
    • Creating particles
    • A template class for all the examples
    • ParticleMaterial
    • BitmapParticleMaterial
      • Using a dynamically drawn bitmap as BitmapParticleMaterial
        • Passing a ParticleBitmap instance to the BitmapParticleMaterial constructor
      • Using a loaded bitmap as BitmapParticleMaterial
    • MovieAssetParticleMaterial
      • Creating an animated movie clip for Flash, Flex Builder, and Flash Builder
      • Exporting the animated clip as an SWC for Flex Builder and Flash Builder to use
      • Creating the document class for Flash, Flex Builder, and Flash Builder
      • Adding interactivity to MovieAssetParticleMaterial
      • Embedding a bitmap in Flex Builder and Flash Builder as the source of MovieAssetParticleMaterial
    • Creating particle fields with the ParticleField class
    • Particles don't have to be tiny—a billboard example
    • The Flint particle system
      • Downloading the Flint particle system
      • Creating a fountain of shiny balls with Flint
        • The emitter
        • The counter
        • Initializers
        • Actions
        • The renderer
    • Summary
  • Chapter 11: Filters and Effects
    • What are filters and effects?
    • Using Flash filters to create effects
      • Applying BlurFilter, DropShadowFilter, and GlowFilter to a 3D object
    • Setting the transparency and blend mode of a viewport layer
      • Changing filters, alpha, and blend mode dynamically
    • Applying filters on viewport level
      • Directly apply filters to the entire viewport
      • Apply filters on viewport level with BitmapViewport3D
    • Built-in Papervision3D effects
      • Creating an effect layer
      • Methods to affect the way the effect is displayed
        • Adding a color effect with BitmapColorEffect
        • Adding a fire effect with BitmapFireEffect
        • Adding a pixelating effect with BitmapPixelateEffect
        • Adding a motion effect with BitmapMotionEffect
    • Adding a Flash filter as an effect with BitmapLayerEffect
      • Combining effects
      • Adjusting the effect with BitmapDrawCommand
    • Adding fog with FogFilter
    • Adding reflection with ReflectionView
      • Adding objects with no reflection
    • Example—creating depth of field
    • Summary
  • Chapter 12: 3D Vector Drawing and Text
    • VectorVision: 3D vector text and drawing
    • Creating a template class for the 3D text examples
    • How to create and add 3D text
    • Font creation
    • Adding interactivity to 3D vector text and shapes
      • Adding interactivity to 3D text
    • Drawing vector shapes—lines, circles, and rectangles
    • Drawing lines with Lines3D
      • How drawing with Lines3D works
      • Straight lines
      • Curved lines
      • Adding lines with addNewLine()
      • Creating segmented lines
      • Adding interactivity to Lines3D lines
      • Growing lines example
    • Summary
  • Chapter 13: Optimizing Performance
    • Measuring performance
    • Basic optimization strategies
      • Stage quality
      • Other general Flash optimizations
      • Destroy unwanted objects
      • Viewport size
      • Camera frustum and field of view
      • Culling
      • Creative thinking
    • Optimizing materials
      • Transparency
      • Tiled
      • Power of two textures
      • Material size
      • Animated materials
    • Optimizing objects
      • Remove objects that are behind other objects
      • Level of detail
    • Optimizing shading
    • Optimizing rendering
      • Only render when you need to
      • Selective rendering
      • Viewport scaling
    • Summary

Paul Tondeur

Paul Tondeur is as an internet entrepreneur who lives and works in Amsterdam, the Netherlands.

He started as a freelance PHP and Flash developer during his study multimedia technology in 2003. After successfully completing his study he was asked to become the CTO of a Dutch online marketing agency in 2004. At this company he developed a strong interest for 3D and got the chance to get professionally involved as the technical lead for serious Second Life projects. Second Life was too limited to fulfill his needs to create accessible interactive multiplayer 3D on the web and this is when he found out about Papervision3D during the early days. Because of his passion for the Flash platform this was love at first sight.

At the beginning of 2009, Paul decided he had to take more advantage of his technical skills as an internet entrepreneur. Currently he helps other companies as a Unity, Papervision3D, Red5 and mobile streaming consultant. Together with a team of people around him, he is also involved in creating a browser based MMO, incorporating the usage of Red5, Unity, Flash and Papervision3D.


Jeff Winder

Jeff Winder is an independent Flash developer living and working in Amsterdam, the Netherlands. He discovered Flash and ActionScript in 2003, mainly creating timeline animation, but was soon gripped by non-timeline coding. He has a special interest in new technologies that are related to Flash, especially open-source projects such as WiiFlash, FLARToolKit, and Papervision3D. Jeff acquired an MSc in Social Psychology at the University of Amsterdam. He is also a passionate musician, playing guitar and drums. Since 2006 Jeff has been self-employed and working for leading agencies. URL:

Code Downloads

Download the code and support files for this book.

Submit Errata

Please let us know if you have found any errors not listed on this list by completing our errata submission form. Our editors will check them and add them to this list. Thank you.


- 6 submitted: last submission 26 Oct 2012

Errata type: Technical | Page number: 60

On page 60, the second sentence on top of the page reads: "The fifth and sixth parameters define the number of segments." However, it is really the fourth and fifth parameters that define the number of segments. The Plane constructor only takes 5 parameters in total.


Errata type: Technical | Page number: 48

sphere.localRotationX += 1; should be sphere.localRotationY += 1;


Errata type: Content | Page number: 85

On page 85 it is stated that: 'all examples we've seen so far used wireframe material'. This is not correct as the Cube example used color material


Errata type: Technical | Page number: 168

Inside the method init( ) on classe MouseInteractionTemplate we have: grid = new DisplayObject3D(); scene.addChild(container); The correct thing ... grid = new DisplayObject3D(); scene.addChild(grid);


Errata type: Technical | Page number: 86

The explanation of the 32-bit color values is wrong. It's not RRGGBBAA, but AARRGGBB (A for alpha, R for red, G for green and B for blue).


Errata type: Grammar | Page number: 28

Please find the following sentence: "Don't worry about the difficulty level if you are new to classes—as book uses only
the basics." This should be changed to "Don't worry about the difficulty level if you are new to classes—as this book uses only
the basics." The word "this" should be added here.

Sample chapters

You can view our sample chapters and prefaces of this title on PacktLib or download sample chapters in PDF format.

Frequently bought together

Papervision3D Essentials +    OpenSceneGraph 3 Cookbook =
50% Off
the second eBook
Price for both: $39.00

Buy both these recommended eBooks together and get 50% off the cheapest eBook.

What you will learn from this book

  • Download, install, and configure your tools for creating Papervision3D applications
  • Employ the document class in Flash, Flash Builder and Flex Builder and use 3D objects as the building blocks for a basic application
  • Learn what materials are and the differences between the available material types, from simple images to movie clips and streaming video
  • Create outstanding effects by implementing different camera types and tricks
  • Discover the workflow of exporting models from Autodesk 3ds Max, SketchUp, and Blender into Papervision3D
  • Optimize the performance and quality of your applications to get the best possible performance
  • Enhance your applications by creating interactive 3D text, 3D vector shapes, and particles
  • Get a deep understanding of important 3D concepts

In Detail

Papervision3D is a powerful real-time 3D engine for Flash. Papervision3D can take externally created 3D models and render them as Flash content, without requiring end-users to download or install an additional plug-in. It has an outstanding reputation within the Flash community and its ease of use has even impressed experienced 3D game developers. However, getting started with Papervision3D can be daunting and mastering it can be challenging. This book guides you through the easiest way to tackle challenges that you may normally face with Papervision3D and master them effectively.

The book will show you how to build Papervision3D applications from scratch in the easiest way, providing plenty of examples that make sense even if you're not a Flash expert. Papervision3D Essentials serves as a comprehensive guide to getting you started, as well as being an invaluable reference for every Papervision3D user and developer. By the end of this book you will be able to create your own projects with real-time 3D rendering.

Since the first release of Papervision3D in 2007, the authors have been involved in various commercial projects with Papervision3D, building up a deep understanding of the engine. In Papervision3D Essentials, the authors share their knowledge to help you create stunning 3D content in Flash and teach you how to work with one of the most exciting open-source Flash projects around. Papervision3D Essentials shows you how to download Papervsion3D and make it work in Flash, Flash Builder and Flex Builder. It provides a short introduction to Object Oriented Programming and classes for those who are new to non-timeline programming. Then, it takes a closer look at the engine, discussing a broad range of topics from how to work with built-in 3D objects to using and animating cameras, 3D objects, and light. Applying materials and textures, using filters and effects, particles and performance optimizations are also covered. Ultimately, this book will provide you with the information you need to build your first Papervision3D application. Covering the basics, but by no means limited to beginners, Papervision3D Essentials provides a thorough explanation of the engine and numerous tips and tricks, making it a valuable resource for every Papervision3D user.

A practical guide for creating 3D in Flash and a reference for every Papervision3D user


This book is a step-by-step guide, which starts at an easy level for beginners and then gradually works to more advanced topics bit-by-bit. It covers code examples explained in detail and also a number of demos, which illustrate theoretical concepts. This book can also be used as a reference guide by readers who have already mastered Papervision3D.

Who this book is for

This book is aimed at readers who want to get started with Papervision3D. The book is also aimed at Flash and 3D developers wanting to extend and amplify their existing development skills, empowering them to build new types of applications. The book assumes that you have some experience with ActionScript 3.0, but you do not have to be familiar with classes and Object Oriented Programming; an introduction on these topics is included.

Code Download and Errata
Packt Anytime, Anywhere
Register Books
Print Upgrades
eBook Downloads
Video Support
Contact Us
Awards Voting Nominations Previous Winners
Judges Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software
Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software