Professional Papervision3d

Professional Papervision3d

Professional Papervision3D Part I: Getting Started Chapter 1: Understanding Flash3D ..................................................................3 Chapter 2: Getting Started With Papervision3D .............................................33 Chapter 3: Rezzing Primitives........................................................................75 Chapter 4: Adding Materials ...................................................................... 127 Part II: Working with Models and Data Chapter 5: Creating 3D Models .................................................................. 173 Chapter 6: Working with Particle Systems ..................................................221 Chapter 7: Geocoding, XML, and Databases ............................................... 253 Chapter 8: Gliding on AIR........................................................................... 285 Part III: Building Games and Websites Chapter 9: Incorporating 3D Physics .......................................................... 321 Chapter 10: Building 3D Games for Wii .......................................................365 Chapter 11: Integrating the Flash Media Server ..........................................417 Chapter 12: Developing 3D Websites ......................................................... 459 Part IV: Extending PV3D and Beyond Chapter 13: Making 3D Movies ..................................................................491 Chapter 14: Taking Virtual Tours ................................................................ 521 Chapter 15: Adding Services ......................................................................553 Chapter 16: Flash & Math: Exploring Flash 10 and Beyond ......................... 585 Appendix A: Pocket Reference ....................................................................623 Appendix B: Companion Website .................................................................693 Index .........................................................................................................697 Professional Papervision3D Michael Lively A John Wiley and Sons, Ltd., Publication Professional Papervision3D This edition first published 2010 © 2010 John Wiley & Sons, Limited Registered office John Wiley & Sons Ltd, The Atrium, Southern Gate, Chichester, West Sussex, PO19 8SQ, United Kingdom For details of our global editorial offices, for customer services and for information about how to apply for permission to reuse the copyright material in this book please see our website at www.wiley.com. The right of the author to be identified as the author of this work has been asserted in accordance with the Copyright, Designs and Patents Act 1988. All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, electronic, mechanical, photocopying, recording or otherwise, except as permitted by the UK Copyright, Designs and Patents Act 1988, without the prior permission of the publisher. Wiley also publishes its books in a variety of electronic formats. Some content that appears in print may not be available in electronic books. Designations used by companies to distinguish their products are often claimed as trademarks. All brand names and product names used in this book are trade names, service marks, trademarks or registered trademarks of their respective owners. The publisher is not associated with any product or vendor mentioned in this book. This publication is designed to provide accurate and authoritative information in regard to the subject matter covered. It is sold on the understanding that the publisher is not engaged in rendering professional services. If professional advice or other expert assistance is required, the services of a competent professional should be sought. A catalogue record for this book is available from the British Library. ISBN 978-0-470-74266-2 Set in 9/11 Palatino Roman by Macmillan Publishing Solutions Printed in Great Britain by Bell & Bain, Glasgow To Carlotta, my gift from God . and Josh, Sam, James, Mary, Jonathan, Rachael, Abigail, Davy, and Naomi . God’s gifts to us. About the Author Michael Lively is presently working at the University of Central Florida simulating nano - technology in Papervision3D and CS4. He has worked for 22 years in government and academia and has been programming in Flash and Flex for the past 10 years, building learning management systems. He has worked as the Director of Instructional Design at Northern Kentucky University, Manager of Instructional Design at the University of Cincinnati, Department Chair at Palm Beach Community College in Electronics Engineering Technology, and as a freelance consultant. He holds a BA in Mathematics, BS in Chemistry, BSEE in Electrical Engineering, MS in Physics, and is presently completing his Ph.D. in Quantum Physics. Acknowledgments It takes many people to publish a book, and first and foremost, I like to thank everyone at Wiley for their support: specifically I would like to thank Chris Webb, Associate Publisher, whose encouragement and professionalism guided me through the entire writing process, and Kenyon Brown, development editor, who kept everything moving on track and in the right direction. Also, a big thanks to Dan Orlando, technical editor of the book who ’ s technical insight made this book possible. We were very fortunate to have Dan aboard and he played an integral part in the book ’ s creation. Finally, many thanks to my lovely wife Carlotta who spent many hours helping me proof and edit the book. Credits Associate Publisher Associate Production Director Chris Webb Martin Tribe Assistant Editor Project Coordinator, Cover Colleen Goldring David Mayhew Publishing Assistant Copy Editor Ellie Scott Anne O’Rorke Development Editor Compositor Kenyon Brown Macmillan Publishing Solutions, Chennai, India Technical Editor Proofreader Dan Orlando Martin Horsgood Project Editor Indexer Juliet Booker Jack Lewis – j&j indexing Production Editor Cover Image Claire Spinks © Punchstock/Score by Aflo Editorial Director Michelle Leete Contents Acknowledgments viii Introduction xxi Part I: Getting Started Chapter 1: Understanding Flash3D 3 3D Coordinates in Flash 10 4 Building a 3D Flash 9 Engine in 18 Lines of Code 5 Applying Thales Theorem 5 Deriving the Scaling Equation 6 Rendering to the Screen 8 Coding Animation 9 Running the Code 11 Vanishing Point (Asymptotic Zero) 12 Adding a Camera 13 Using CS4 (3D Flash 10 Engine in 13 Lines of Code) 14 Vanishing Point 14 Using the Big 3 15 Translation 15 Rotation 21 Scaling (Basic Principles of Animation) 28 Summary 32 Chapter 2: Getting Started With Papervision3D 33 Getting Papervision3D 33 Diving into 3D 34 Shapes Versus Objects 35 Hidden Surface Drawing 37 Painter’s Algorithm 37 The View Frustum (Culling and Clipping) 38 Exploring the Guts of Papervision3D 39 DisplayObject3D 41 Running Papervision3D Four Different Ways (Hello World) 41 Using Flash or Flex 42 Contents Building a Class 43 Writing an OOP (Object Oriented) Class 43 Formulating a Papervision3D Class 50 Running Papervision3D Applications 57 Document Class 57 Class Path 58 Flex Builder 59 Adding Motion 60 Setting the Stage 65 Align 65 Scale Mode 66 Quality 66 Using BasicView (Hello Plane) 67 Encapsulation 69 Undulating Sphere using BasicView 69 Incorporating CS4 72 Summary 73 Chapter 3: Rezzing Primitives 75 Understanding Primitives 75 Exploring the Guts of a Papervision3D Primitive 76 Rezzing Primitives to the Stage 79 Prim Template Code (Using a Wireframe Material) 80 Plane 81 Cube 83 Making Ellipsoids 95 Creating Custom Prims 96 Pinched Sphere 96 Pyramid 97 Geodesic 99 Curved Plane 100 Puckered Cube 101 Torus 102 Tube 105 Hourglass 107 Second Life Tree 108 Double-Sided Plane 110 Creating CS4 Primitives 110 Second Life Tree in Flash CS4 111 Plane 114 Cube 114 xii Contents Pyramid 118 CS4 Super Prim (Plane, Cylinder, Cone, Sphere, Half Torus . ) 120 Dissecting the Big Three 125 Camera and Viewport 126 Summary 126 Chapter 4: Adding Materials 127 Applying Textures 127 Using Simple Materials (or just Materials) 129 Material Types 130 Adding Materials to a Prim 130 Bitmaps 134 Movie Clips 142 Understanding Light 147 Using Shaders 148 Adding Brightness 160 Bump Map 162 Summary 169 Part II: Working with Models and Data Chapter 5: Creating 3D Models 173 Modeling for Papervision3D 173 Bringing Down the Count 174 Gauging Performance in PV3D 175 Choosing a Modeling Application 176 Blender 177 3DSMax 178 Google SketchUp 178 Swift3D 179 Papervision3D Importers 179 What’s MD2? 180 Model Pack 181 Creating MD2 Files (MilkShape to the Rescue) 185 Making Things Move 186 What’s Up with KMZ? 187 Hello Collada 187 Single and Multiple Objects with Simple Images 188 Single Object with Multiple Images 191 Interactive Objects (or Vehicles) and Environments 194 xiii Contents Animated Objects 198 What’s Up with SketchUp? 200 Binary versus XML 201 Writing Your Own Parsers 201 Papervision3D and Collada 202 Simple Blender Exporters 202 Simple 3DSMax Exporters 204 Understanding Collada Parsers 204 Processing Images (and Pixel Bender) 206 What’s Pixel Bender? 206 Getting Started with Pixel Bender 207 Writing a Pixel Bender Filter 208 Adding Parameters 210 Typical Point Processes 210 Grayscale 211 Complement 211 Brightness 211 Exposure 211 Color Balance 211 Binary Contrast 212 Simple Pixelate 212 Simple Blur 212 Sharpen 213 Simple Point Light 213 Bloom Brightness 214 Multiple Image Processing 214 CrossFade 214 Subtraction and Addition 214 Bringing Pixel Bender into

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    751 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us