Away3D 3.6 Cookbook
()
About this ebook
Related to Away3D 3.6 Cookbook
Related ebooks
Three.js Cookbook Rating: 0 out of 5 stars0 ratingsBlender 3D: Characters, Machines, and Scenes for Artists Rating: 0 out of 5 stars0 ratingsPanda3d 1.7 Game Developer's Cookbook Rating: 0 out of 5 stars0 ratings3D Printing with RepRap Cookbook Rating: 2 out of 5 stars2/5PlayStationå¨Mobile Development Cookbook Rating: 0 out of 5 stars0 ratingsBlender 3D Cookbook Rating: 5 out of 5 stars5/5Unreal Development Kit Game Design Cookbook Rating: 0 out of 5 stars0 ratingsOpenCV 3 Computer Vision Application Programming Cookbook: Recipes to make your applications see Rating: 0 out of 5 stars0 ratingsLua Game Development Cookbook Rating: 0 out of 5 stars0 ratingsCryENGINE 3 Cookbook: Over 90 recipes written by Crytek developers for creating third-generation real-time games Rating: 0 out of 5 stars0 ratingsUnity 5.x Cookbook: More than 100 solutions to build amazing 2D and 3D games with Unity Rating: 3 out of 5 stars3/5AndEngine for Android Game Development Cookbook Rating: 0 out of 5 stars0 ratingsOpenGL Development Cookbook Rating: 5 out of 5 stars5/5Lumion 3D Cookbook Rating: 0 out of 5 stars0 ratingsUnity 5.x Animation Cookbook Rating: 0 out of 5 stars0 ratingsExt JS 3.0 Cookbook Rating: 0 out of 5 stars0 ratingsData Visualization with D3 4.x Cookbook - Second Edition Rating: 0 out of 5 stars0 ratingsCocos2d-x Cookbook Rating: 0 out of 5 stars0 ratingsAndroid Application Development Cookbook - Second Edition Rating: 5 out of 5 stars5/5Dart Cookbook Rating: 0 out of 5 stars0 ratingsQGIS Python Programming Cookbook Rating: 0 out of 5 stars0 ratingsCoffeeScript Application Development Cookbook Rating: 0 out of 5 stars0 ratingsProcessing 2: Creative Programming Cookbook Rating: 4 out of 5 stars4/5Python Data Visualization Cookbook Rating: 4 out of 5 stars4/5Cocos2d for iPhone 1 Game Development Cookbook Rating: 0 out of 5 stars0 ratings
Information Technology For You
Excel VBA: A Step-By-Step Tutorial For Beginners To Learn Excel VBA Programming From Scratch: 1 Rating: 4 out of 5 stars4/5An Ultimate Guide to Kali Linux for Beginners Rating: 3 out of 5 stars3/5Supercommunicator: Explaining the Complicated So Anyone Can Understand Rating: 3 out of 5 stars3/5Creating Online Courses with ChatGPT | A Step-by-Step Guide with Prompt Templates Rating: 4 out of 5 stars4/5Summary of Super-Intelligence From Nick Bostrom Rating: 4 out of 5 stars4/5COMPUTER SCIENCE FOR ROOKIES Rating: 0 out of 5 stars0 ratingsHow to Write Effective Emails at Work Rating: 4 out of 5 stars4/5Cybersecurity for Beginners : Learn the Fundamentals of Cybersecurity in an Easy, Step-by-Step Guide: 1 Rating: 0 out of 5 stars0 ratingsCompTia Security 701: Fundamentals of Security Rating: 0 out of 5 stars0 ratingsData Analytics for Beginners: Introduction to Data Analytics Rating: 4 out of 5 stars4/5Learning Microsoft Endpoint Manager: Unified Endpoint Management with Intune and the Enterprise Mobility + Security Suite Rating: 0 out of 5 stars0 ratingsCompTIA ITF+ CertMike: Prepare. Practice. Pass the Test! Get Certified!: Exam FC0-U61 Rating: 5 out of 5 stars5/5The iPadOS 17: The Complete User Manual to Quick Set Up and Mastering the iPadOS 17 with New Features, Pictures, Tips, and Tricks Rating: 0 out of 5 stars0 ratingsCompTIA A+ CertMike: Prepare. Practice. Pass the Test! Get Certified!: Core 1 Exam 220-1101 Rating: 0 out of 5 stars0 ratingsHow to Find a Wolf in Siberia (or, How to Troubleshoot Almost Anything) Rating: 0 out of 5 stars0 ratingsInkscape Beginner’s Guide Rating: 5 out of 5 stars5/5Who Says Elephants Can't Dance?: Leading a Great Enterprise Through Dramatic Change Rating: 4 out of 5 stars4/5A Practical Guide Wireshark Forensics Rating: 5 out of 5 stars5/5Design and Build Modern Datacentres, A to Z practical guide Rating: 3 out of 5 stars3/5Self-Sovereign Identity Rating: 0 out of 5 stars0 ratingsDevOps Handbook: What is DevOps, Why You Need it and How to Transform Your Business with DevOps Practices Rating: 4 out of 5 stars4/5CompTIA Network+ CertMike: Prepare. Practice. Pass the Test! Get Certified!: Exam N10-008 Rating: 0 out of 5 stars0 ratingsGetting started with Audacity 1.3 Rating: 5 out of 5 stars5/5The Programmer's Brain: What every programmer needs to know about cognition Rating: 5 out of 5 stars5/5The Design Inference Rating: 5 out of 5 stars5/5Microsoft Access for Beginners and Intermediates Rating: 0 out of 5 stars0 ratings
Reviews for Away3D 3.6 Cookbook
0 ratings0 reviews
Book preview
Away3D 3.6 Cookbook - Michael Ivanov
Table of Contents
Away3D 3.6 Cookbook
Credits
About the Author
Acknowledgement
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers and more
Why Subscribe?
Free Access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code for this book
Errata
Piracy
Questions
1. Working with Away3D Materials
Introduction
Using a single MovieClip for multiple materials
Getting ready
How to do it...
How it works...
There's more...
Controlling the MovieClip of MovieMaterial
Getting ready
How to do it...
How it works...
Streaming VOD from FMS for VideoMaterial
Getting ready
How to do it...
How it works...
Interpolating material color dynamically with DepthBitmapMaterial
Getting ready
How to do it...
How it works...
Creating normal maps in Photoshop
Getting ready
How to do it...
Generating normal maps using Away3D NormalMapGenerator
Getting ready
How to do it...
How it works...
There's more…
Generating a normal map using the NormalBumpMaker utility
See also
Getting your hands dirty with Pixel Bender materials
Getting ready
How to do it...
How it works...
There's more...
Exploring Fresnel Shader
Assembling composite materials
Getting ready
How to do it...
How it works...
2. Working with Away3D Cameras
Introduction
Creating an FPS controller
Getting ready
How to do it...
How it works...
Creating Camera Depth of Field Effect
Getting ready
How to do it...
How it works...
There's more...
Creating DOF on Mesh Objects
Detecting whether an object is in front of or behind the camera
Getting ready
How to do it...
How it works...
There's more...
Changing lenses
Getting ready
How to do it...
How it works...
There's more...
Following a third-person view with a spring camera
Getting ready
How to do it...
How it works...
There's more...
Tracking screen coordinates of 3D objects
Getting ready
How to do it...
How it works...
There's more...
See also
Transforming objects in 3D space relative to the camera position
Getting ready
How to do it...
How it works...
Using Quaternion camera transformations for advanced image gallery viewing
Getting ready
How to do it...
How it works...
See also
3. Animating the 3D World
Introduction
Animating (Rigging) characters in 3DsMax
Getting ready
How to do it...
How it works...
There's more...
See also
Controlling bones animation in Collada
Getting ready
How to do it...
How it works...
See also
Working with MD2 animations
Getting ready
How to do it...
How it works...
See also
Morphing objects
Getting ready
How to do it...
How it works...
See also
Animating geometry with Tween engines
Getting ready
How to do it...
How it works...
Moving an object on top of the geometry with FaceLink
Getting ready
How to do it...
How it works...
4. Fun by Adding Interactivity
Introduction
Adding rotational interactivity to an Away3D primitive by using Mouse movements
Getting ready
How to do it...
How it works...
There's more...
See also
Implementing advanced object rotation using vector math
Getting ready
How to do it...
How it works...
See also
Creating advanced spherical surface transitions with Quaternions
Getting ready
How to do it...
How it works...
There's more...
See also
Interactively painting on the model's texture
Getting ready
How to do it...
How it works...
There's more...
See also
Dragging on geometry by unprojecting mouse coordinates
Getting ready
How to do it...
How it works...
See also
Morphing mesh interactively
Getting ready
How to do it...
How it works...
See also
Creating a controllable non-physical car
Getting ready
How to do it...
How it works...
See also
5. Experiencing the Wonders of Special Effects
Introduction
Exploding geometry
Getting ready
How to do it...
How it works...
There's more...
Getting ready
How to do it...
How it works...
See also
Creating advanced bitmap effects using filters
Getting ready
How to do it...
How it works...
See also
Creating clouds
Getting ready
How to do it...
How it works...
See also
Visualizing sound in 3D
Getting ready
How to do it…
How it works...
There's more...
Creating lens flair effects
Getting ready
How to do it…
How it works...
There's more...
Masking 3D objects
Getting ready
How to do it...
How it works...
There's more...
6. Using Text and 2D Graphics to Amaze
Introduction
Setting dynamic text with TextField3D
Getting ready
How to do it...
How it works...
There's more...
Interactive animation of text along a path
Getting ready
How to do it...
How it works...
See also
Creating 3D objects from 2D vector data
Getting ready
How to do it...
How it works...
There's more...
Drawing with segments in 3D
Getting ready
How to do it...
How it works...
There's more...
See also
Creating a 3D illusion with Away3D sprites
Getting ready
How to do it...
How it works...
See also
7. Depth-sorting and Artifacts Solutions
Introduction
Fixing geometry artifacts with Frustum and NearField clipping
Getting ready
How to do it...
How it works...
There's more…
Removing artifacts from intersecting objects
Getting ready
How to do it...
How it works...
Solving depth-sorting problems with Layers and Render Modes
Getting ready
How to do it...
How it works...
There's more…
Z-Sorting using QuadrantRenderer
8. Prefab3D
Introduction
Exporting models from Prefab
Getting ready
How to do it…
How it works...
There's more...
See also
Normal mapping with Prefab
Getting ready
How to do it…
How it works...
See also
Maintaining workflow with AwayConnector
Getting ready
How to do it…
How it works...
UV map editing with Prefab
Getting ready
How to do it…
How it works...
Creating terrain
Getting ready
How to do it…
How it works...
See also
Generating light maps
Getting ready
How to do it…
There's more...
Creating and animating paths
Getting ready
How to do it…
How it works...
There's more...
9. Working with External Assets
Introduction
Exporting models from 3DsMax/Maya/Blender
Getting ready
How to do it...
How it works...
There's more...
See also
Exporting models from 3DsMax to ActionScript class
Getting ready
How to do it...
How it works...
There's more...
Preparing MD2 models for Away3D in MilkShape
Getting ready
How to do it...
How it works...
There's more...
See also
Loading and parsing models (DAE, 3ds, Obj, MD2)
Getting ready
How to do it...
How it works…
There's more...
Storing and accessing external assets in SWF
Getting ready
How to do it…
How it works…
See also
Preloading 3D scene assets
Getting ready
How to do it...
How it works…
There's more...
There's more
10. Integration with Open Source Libraries
Introduction
Setting Away3D with JigLib
Getting ready
How to do it…
How it works…
See also
Creating a physical car with JigLib
Getting ready
How to do it…
How it works…
See also
Morphing Away3D geometry with AS3DMOD
Getting ready
How to do it...
How it works…
See also
Exploding particles with FLINT
Getting ready
How to do it…
How it works…
See also
Setting Augmented Realty with FLARToolkit in Away3D
Getting ready
How to do it...
How it works...
Adding Box2D physics to Away3D objects
Getting ready
How to do it…
How it works…
There's more...
11. Away3D Lite
Introduction
Setting up Away3D Lite using templates
Getting ready
How to do it...
How it works...
Importing external models in Away3D Lite
Getting ready
How to do it...
How it works...
There's more...
Manipulating geometry
Getting ready
How to do it...
How it works...
There's more...
Making 2D shapes appear three dimensional by using Sprite3D
Getting ready
How to do it...
How it works...
Managing Z-Sorting by automatic sorting and using layers
Getting ready
How to do it...
How it works...
There's more...
Sorting using layers
Creating virtual trackball
Getting ready
How to do it...
How it works...
There's more...
Writing Away3D Lite applications with haXe
Getting ready
How to do it...
How it works...
There's more...
12. Optimizing Performance
Introduction
Defining depth of rendering
Getting ready
How to do it...
How it works...
See also
Restricting the scene poly count
Getting ready
How to do it...
How it works...
See also
Working with LOD objects
Getting ready
How to do it...
How it works...
Optimizing geometry by welding vertices
Getting ready
How to do it...
How it works...
There's more...
See also
Excluding objects from rendering
Getting ready
How to do it...
How it works...
Image size consideration
Getting ready
How to do it...
How it works...
Important tips for performance optimization
13. Doing More with Away3D
Introduction
Moving on uneven surfaces
Getting ready
How to do it...
How it works...
See also
Detecting collisions between objects in Away3D
Getting ready
How to do it...
AABB test:
How it works...
There's more...
AABS test
Ray — AABS intersection test
Ray Triangle test
See also
Creating cool effects with animated normal maps
Getting ready
How to do it...
How it works...
See also
Creating skyboxes and their textures
Getting ready
How to do it...
Creating a SkyBox6-compatible texture
Skybox setup in Away3D
How it works...
Running heavy scenes faster using BSP trees
Getting ready
How to do it...
How it works...
A. Beginning Molehill API
Creating a rotating sphere from scratch
Getting ready
How to do it...
How it works...
There's more...
Compacting the matrix operations
See also
Index
Away3D 3.6 Cookbook
Away3D 3.6 Cookbook
Copyright © 2011 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: May 2011
Production Reference: 1190511
Published by Packt Publishing Ltd.
32 Lincoln Road
Olton
Birmingham, B27 6PA, UK.
ISBN 978-1-849512-80-0
www.packtpub.com
Cover Image by Charwak A ( <[email protected]> )
Credits
Author
Michael Ivanov
Reviewer
J. Pradeek
Ronen Tsamir
Development Editor
Maitreya Bhakal
Technical Editors
Prashant Macha
Gauri Iyer
Copy Editor
Leonard D'Silva
Project Coordinator
Michelle Quadros
Proofreader
Joanna McMahon
Indexer
Hemangini Bari
Graphics
Nilesh R. Mohite
Production Coordinator
Aparna Bhagat
Cover Work
Aparna Bhagat
About the Author
Michael Ivanov, although initially dreaming of becoming an historian while in the middle of his undergraduate studies in Hebrew at the University of Jerusalem, understood that his real passion was computers. Today he is a professional Flash developer working in the field of web and game development for more than 5 years. Being a researcher by nature with a strong hunger for technological exploration, he constantly broadens his professional knowledge by exploring a wide range of technologies from different fields of computer science where real time 3D engines are of primary interest. For the past 2 years, Michael has been working as lead programmer for Neurotech Solutions Ltd, which is a rapidly growing Israeli startup bringing revolutionizing solutions in the field of research and treatment of ADHD. Michael led a development of unique ADHD training game programs which have been based on the Adobe Flash platform powered by open source 3D libraries such as PV3D and Away3D. Although in everyday life he works mostly on RIA and desktop applications development, his true passion is 3D graphics and game programming. In his little spare time, Michael works with such technologies as Java3D Epic's UDK, Unity3D, and a wide range of Flash open source 3D libraries from which Away3D is his favorite. Michael is a zealous promoter of cutting edge 3D technologies especially of open source and misses no opportunity to speak on these subjects at local game industry events and conferences. Born in Russia, Michael has lived and worked in Israel for more than 12 years. When he is not writing a code, he enjoys playing around with his 3-year-old son David as well as reading history books and running.
You can find him on the web on his personal blog http://blog.alladvanced.net. Or as an active member of the Away3D developers' community group at http://groups.google.com/group/away3d-dev?pli=1.
Acknowledgement
I would like to express my thanks to Ralph Hauwert, John Lindquist, Carlos Ulloa , Mr. Doob, Keith Peters for their incredible work that served me as an inspiration for many recipes in this book. Thanks to the Away3D team who always found time to answer my nagging questions in the middle of their hard work on the next version of the engine. Fabrice3D deserves a special credit for his help and for contributing to the community Prefab3D
Special thanks to GreenSock (www.greensock.com) team who allowed me to use their wonderful tween engine TweenMax.
Many thanks to Tom Tallian (http://tomtallian.com/) for creating those cute Team Fortress
low poly characters (whereas the Spy is my favorite and featuring in this book) and making them available for free of charge.
I would like to thank the Packt publishing for allowing me to put on paper this humble writing. I would not have been able to accomplish this book without the guidance and assistance by Acquisition editors Darshana Shinde and Maitreya Bhakal who accompanied me all the way to publishing. Last, but not the least, I want to express my great appreciation to Ronen Tzamir and Pradek for reviewing my stuff despite their daily workloads.
Finally a word for Flash community in general and especially to Away3D users group. One of the inspirations that served me as a driving force in this endeavor was my dedication and thankfulness to the community and the open source concept. I owe a bulk of my knowledge to these two. Thank you folks and I hope you will enjoy reading this book.
About the Reviewers
J.Pradeek is currently a computer science student at B.S.A Crescent Engg. College in Chennai, India. He has been working with Flash since his school days. He is specifically interested in working on emerging new web technologies and can be found programming in his free time. Contact Pradeek at <[email protected]>.
Ronen Tsamir is the R&D manager of Revolver LTD where he leads the FreeSpin3D development. FreeSpin3D is a 3D engine for Flash developers and designers.
Ronen also develops different unique 3D games engines according to special requirements.
Ronen has 25 years of experience in games development, starting at the age of twelve years with Spectrum 48k through Apple II up to today's new age cellular telephones.
Since the beginning of this century, he has been focusing especially on 3D games using mainly DirectX and Flash ActionScript.
Ronen's three main strengths are keeping your code simple and flexible, keeping the CPU low, and keeping the user interface accessible.
Ronen Tsamir web (Hebrew / English): http://Ronen.tsamir.net.
www.PacktPub.com
Support files, eBooks, discount offers and more
You might want to visit www.PacktPub.com for support files and downloads related to your book.
Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at
At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks.
http://PacktLib.PacktPub.com
Do you need instant solutions to your IT questions? PacktLib is Packt's online digital book library. Here, you can access, read and search across Packt's entire library of books.
Why Subscribe?
Fully searchable across every book published by Packt
Copy and paste, print and bookmark content
On demand and accessible via web browser
Free Access for Packt account holders
If you have an account with Packt at www.PacktPub.com, you can use this to access PacktLib today and view nine entirely free books. Simply use your login credentials for immediate access.
This book is a humble gift to my dear parents who always taught me that the sky is the limit and only through hard work do dreams come true
Preface
Three dimensions are better than two—and it's not a secret anymore that 3D is here to stay. Gone are the days when Flash was just used for 2D animations. In the last few years, online Flash content has undergone a revolution with the introduction of real-time 3D engines for Flash. Away3D is the big daddy of them all—which makes it the ultimate resource for top-rated 3D content development and for powering today's coolest games and Flash sites. The Away 3D 3.6 Cookbook is your answer to learning all you need to take your Flash or Away3D skills to the next level—and having fun doing it.
This book is your practical companion that will teach you more than just the essentials of Away3D, and will provide you with all the tools and techniques you need to create a stunning 3D experience. You will find recipes targeting every possible field related to Away3D, 3D development pipelines, and best practices in general. You will find practically relevant content exploring advanced topics, which will clear your way to developing cutting edge applications—not to mention saving hours of searching for help on the internet.
The recipes in this book will teach you diverse aspects of 3D application development with Away3D. They will guide you through essential aspects such as creation of assets in external programs and their integration into Away3D, working with material, animation, interactivity, special effects, and much more. Each topic is packed with recipes targeting different levels of complexity, so that even experienced Away3D developers will find a lot of useful and unique information.
By the time you are done with this book, you'll be creating your own awesome Away 3D applications and games in less time than you can say design
.
What this book covers
Chapter 1, Working with Away3D Materials: In this chapter, you will learn how to create different types of Away3D material including PixelBender-based shaders. The chapter also covers advanced topics such as Normal mapping and FMS VOD streaming for VideoMaterial.
Chapter 2, Working with Away3D Cameras: Here you get acquainted with Away3D cameras. You will also learn to set up a First Person Controller, creating cool camera effects, dive into advanced 3D math by learning to perform complex camera transformations, and so on.
Chapter 3, Animating the 3D World: This chapter is going to teach you how to breathe life into your 3D world. It covers important topics such as the character animation setup in different formats, animation control, mesh morphing effects, and tweening 3D objects with the help of Tween Engine.
Chapter 4, Fun by Adding Interactivity: Time for fun! And what can be more fun than playing interactively within your 3D world. This chapter covers the most essential as well as advanced topics regarding 3D transformations. Also after finishing it, you will be able to create a fully interactive controllable car!
Chapter 5, Experiencing the Wonders of Special Effects: There is no way successful 3D content can exist without having special effects applied. Besides passing through a quick demolition course, you will learn creating sound visualization, realistic animated clouds, as well as advanced bitmap manipulation.
Chapter 6, Using Text and 2D Graphics to Amaze: How can 2D exist inside 3D? Yes it can! Learn how to create 3D text by faking a 3D look using Away3D sprites and place 2D vector shapes inside your 3D environment.
Chapter 7, Depth-sorting and Artifacts Solutions: Knowing how to model in your favorite 3D package is not quantum physics. Another matter is to cause your models to look good inside Away3D, which can turn out to be a serious challenge. Here you will meet the tools supplied by Away3D to help you get rid of the irritating Z Fighting
and learn important techniques to fix depth sorting of your objects in the scene using layers. The rendering modes and cases will be explained along with when and how they should be used.
Chapter 8, Prefab3D: Prefab3D is an Adobe AIR visual 3D editor created especially for Away3D, which can significantly boost the developed process and save you a lot of precious hours. In this chapter, you will cover most of the software's features including topics such as models export, terrain generation, and light maps. Also, you will learn how to create, extrude, animate, and export paths for instant usage in Away3D.
Chapter 9, Working with External Assets: The chances are high that you will not be satisfied only by the formidable set of primitive Away3D sets at your disposal. This chapter will guide you through all the major techniques you need to know in order to export custom 3D assets from three major 3D packages—Autodesk 3DdsMax, Maya, and Blender. Additionally, you will learn such important topics such as multiple object loading and a way to compact your 3D assets for a smaller weight using SWF as a resource.
Chapter 10, Integration with Open Source Libraries: Away3D is awesome, but you can make it even more awesome by incorporating other open source libraries into your projects such as particles, physics, and even Augmented Reality engines! Here you will have a quick start with popular frameworks such as FLINT particles, Box2DFlash, JigLibFlash, FLARManager, and AS3DMOD.
Chapter 11, Away3D Lite: Meet the younger brother of Away3D Away3D Lite. It is not as robust and feature packed as Away3D 3.6, but it is incredibly fast! In these 30 plus pages, you are introduced to a kick-off crash course with the Away3D Lite engine which is going to add a lot of horsepower to your 3D toolset.
Chapter 12, Optimizing Performance: While finishing the work on your project, don't hurry to wrap it up. The performance issues are always waiting for you around the corner. The recipes in this chapter contain important tips on how to gain more FPS for your application. Usage of LOD objects, selective rendering, depth rendering restriction, and more will allow you to push the boundaries of what it is possible to do inside the Flash Player.
Chapter 13, Doing More with Away3D: This chapter contains an extra or bonus material which is not specifically theme related. Here we cover some advanced topics such as collision detection, moving on uneven terrain, and so on. Moreover, you will get introduced to the powerful BSP trees system that allows creating really vast indoor environments while having your FPS high and steady.
Appendix A, Beginning Molehill API: This appendix has nothing to do with the rest of the book as it introduces the next generation GPU-accelerated Flash Player that includes a 3D low-level API called Molehill allowing you to create true 3D content with unprecedented performance. If a while ago you wondered how to squeeze 10,000 triangles into an Away3D scene without killing the CPU, you can now load hundreds of thousands of polygons and the frame rate will not even blink! The appendix wraps a single recipe, which will give you an in depth introduction to Molehill API with the practical example of creating rotating sphere primitives from scratch.
What you need for this book
Adobe Flex 2,3, or Flash Builder4
Adobe Flash cs4/cs5
Adobe Photoshop cs4/cs5
FlashDevelop
Autodesk 3DDds Max (version 7 or later)
Terragen and TerraSky
FMS 3.5
BlazeDS
MilkShape
Prefab
Who this book is for
The book is written for experienced Flash developers who want to work with the Away3D engine as well as for those who are already acquainted with the engine but wish to take their skills to the next level.
Basic knowledge of Away3D and familiarity with ActionScript 3.0 and OOP concepts is assumed.
Conventions
In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.
Code words in text are shown as follows: Set up a basic Away3D scene extending the AwayTemplate class and you are ready to go.
A block of code is set as follows:
private function setSphericalLens():void{
_hoverCam.lens=_sphericalLens;
_hoverCam.fov=56;
}
New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in the text like this: Click Build and then Apply button. You should see a similar model in your viewport
.
Note
Warnings or important notes appear in a box like this.
Tip
Tips and tricks appear like this.
Reader feedback
Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.
To send us general feedback, simply send an e-mail to <[email protected]>, and mention the book title via the subject of your message.
If there is a book that you need and would like to see us publish, please send us a note in the SUGGEST A TITLE form on www.packtpub.com or e-mail
If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide on www.packtpub.com/authors.
Customer support
Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.
Downloading the example code for this book
You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the files e-mailed directly to you.
Errata
Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you would report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/support, selecting your book, clicking on the errata submission form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded on our website, or added to any list of existing errata, under the Errata section of that title. Any existing errata can be viewed by selecting your title from http://www.packtpub.com/support.
Piracy
Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works, in any form, on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.
Please contact us at <[email protected]> with a link to the suspected pirated material.
We appreciate your help in protecting our authors, and our ability to bring you valuable content.
Questions
You can contact us at <[email protected]> if you are having a problem with any aspect of the book, and we will do our best to address it.
Chapter 1. Working with Away3D Materials
In this chapter, we will cover:
Using a