PacktLib: Papervision3D Essentials

Papervision3D Essentials

Credits

About the Authors

About the Reviewers

Preface

Setting Up

Downloading Papervision3D

Downloading the non-compiled source using SVN

Downloading the non-compiled source in the ZIP file

Downloading the compiled source

Configuring your authoring tool for Papervision3D

Where to find the Papervision3D documentation

Summary

Building Your First Application

Introduction to classes and object-oriented programming

Working with the Document Class/Main Application File

Basics of a 3D scene in Papervision3D

Creating a basic class for Papervision3D

Smart programmers use less code

Preparing for the book examples

Summary

Primitives

The basic elements of 3D objects

The rendering pipeline

Creating and adding primitives

Nesting

Accessing vertices

Summary

Materials

Introduction to materials

Basic materials

Three ways of using bitmaps as a material

Two ways of using a movie clip as material

VideoStreamMaterial

Combining materials

Interactivity

Tips and tricks

Example—creating a carousel

Summary

Cameras

Cameras inherit from DisplayObject3D

Basic camera settings

Camera types

Setting a target with the lookAt() method

Culling

Clipping

Summary

Moving Things Around

What can we move around?

How can we move things around?

Rotating objects

Mouse interaction

Animating with Tweener

Example—the galaxy extended

Summary

Shading

Introduction to shading

Flat shading

Gouraud shading

Cell shading

Phong shading

Bumping your materials

Reflection mapping

Example—shading the Earth in our galaxy

Summary

External Models

Modeling for Papervision3D

Creating a template class to load models

Creating models in Autodesk 3ds Max and loading them into Papervision3D

Creating and loading models using SketchUp

Creating and loading models using Blender

Keeping control over your materials

Summary

Z-Sorting

What is z-sorting

Layering your renders

Quadtree rendering

Summary

Particles

What particles are and why to use them

Creating particles

A template class for all the examples

ParticleMaterial

BitmapParticleMaterial

MovieAssetParticleMaterial

Creating particle fields with the ParticleField class

Particles don't have to be tiny—a billboard example

The Flint particle system

Summary

Filters and Effects

What are filters and effects?

Using Flash filters to create effects

Setting the transparency and blend mode of a viewport layer

Applying filters on viewport level

Built-in Papervision3D effects

Adding a Flash filter as an effect with BitmapLayerEffect

Adding fog with FogFilter

Adding reflection with ReflectionView

Example—creating depth of field

Summary

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

Drawing vector shapes—lines, circles, and rectangles

Drawing lines with Lines3D

Summary

Optimizing Performance

Measuring performance

Basic optimization strategies

Optimizing materials

Optimizing objects

Optimizing shading

Optimizing rendering

Summary