Introducing Blender Hair
Total Page:16
File Type:pdf, Size:1020Kb
92801ffirs.qxd 5/14/08 9:58 AM Page iv Acquisitions Editor: Mariann Barsolo Development Editor: Kathryn Duggan Technical Editor: Roland Hess Production Editor: Elizabeth Ginns Britten Copy Editor: Sharon Wilkey Production Manager: Tim Tate Vice President and Executive Group Publisher: Richard Swadley Vice President and Executive Publisher: Joseph B. Wikert Vice President and Publisher: Neil Edde Project Manager, I: Laura Moss-Hollister Media Associate Producer: Kit Malone Media Quality Assurance: Josh Frank Compositor and Book Designer: Kate Kaminski, Happenstance Type-O-Rama Proofreader: C.M. Jones Indexer: Ted Laux Cover Designer: Ryan Sneed Cover Images: Milos Zajíc (school corridor) Mike Pan (strawberries and milk) Luma Studios (ClubSilo racing game) Tony Mullen (pop bottle and boxes tumbling) © Blender Foundation | peach.blender.org (cartoon animals) Copyright © 2008 by Wiley Publishing, Inc., Indianapolis, Indiana Published simultaneously in Canada ISBN: 978-0-470-19280-1 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, scanning or otherwise, except as permitted under Sections 107 or 108 of the 1976 United States Copyright Act, without either the prior written permission of the Publisher, or authorization through payment of the appropriate per-copy fee to the Copyright Clearance Center, 222 Rosewood Drive, Danvers, MA 01923, (978) 750-8400, fax (978) 646-8600. Requests to the Publisher for permission should be addressed to the Legal Department, Wiley Publishing, Inc., 10475 Crosspoint Blvd., Indianapolis, IN 46256, (317) 572-3447, fax (317) 572-4355, or online at http://www.wiley.com/go/permissions. Limit of Liability/Disclaimer of Warranty: The publisher and the author make no representations or warranties with respect to the accuracy or completeness of the contents of this work and specifically disclaim all warranties, including without limitation warranties of fitness for a particular purpose. No warranty may be cre- ated or extended by sales or promotional materials. The advice and strategies contained herein may not be suitable for every situation. This work is sold with the understanding that the publisher is not engaged in rendering legal, accounting, or other professional services. If professional assistance is required, the services of a competent professional person should be sought. Neither the publisher nor the author shall be liable for damages arising herefrom. The fact that an organization or Website is referred to in this work as a citation and/or a potential source of further information does not mean that the author or the publisher endorses the information the organization or Website may provide or recommendations it may make. Further, readers should be aware that Internet Websites listed in this work may have changed or disappeared between when this work was written and when it is read. For general information on our other products and services or to obtain technical support, please contact our Customer Care Department within the U.S. at (800) 762-2974, outside the U.S. at (317) 572-3993 or fax (317) 572-4002. Wiley also publishes its books in a variety of electronic formats. Some content that appears in print may not be available in electronic books. Library of Congress Cataloging-in-Publication Data Mullen, Tony, 1971- Bounce, tumble, and splash! : simulating the physical world with Blender 3D / Tony Mullen. -- 1st ed. p. cm. Includes index. ISBN 978-0-470-19280-1 (paper/cd-rom) 1. Computer graphics. 2. Computer simulation. 3. Blender (Computer file) 4. Computer animation. 5. Three-dimensional display systems. I. Title. T385.M8425 2008 006.6'96--dc22 2008014650 TRADEMARKS: Wiley, the Wiley logo, and the Sybex logo are trademarks or registered trademarks of John Wiley & Sons, Inc. and/or its affiliates, in the United States and other countries, and may not be used without written permission. All other trademarks are the property of their respective owners. Wiley Publishing, Inc., is not associated with any product or vendor mentioned in this book. 10 9 8 7 6 5 4 3 2 1 92801ftoc.qxd 5/14/08 10:00 AM Page x Contents Foreword xiii Introduction xv Chapter 1 Re-creating the World: An Overview 1 Re-creating the Physical World with Blender. 2 Blender’s Physical Simulation Functionality 2 The Science of Simulation 5 Nonsimulation Tools and Techniques 6 Using Materials and Textures . 6 Hot Lava with Material Nodes 7 Transparency and Subsurface Scattering 14 Sky Maps 20 Faking Physics with General Tools . 23 Modeling Bodies of Water by Using Modifiers and Textures 24 Faking a Cloth Flag by Using a Displacement Modifier 41 Creating a Poseable Spring by Using an Array Modifier, Shape Keys, and PyDrivers 46 Chapter 2 The Nitty-Gritty on Particles 59 Introducing Particles . 60 Setting Particle Parameters 60 Using the Physics Tab 65 Setting Visualization Options 67 Using the Extras Tab 72 Using Force Fields and Deflection 73 Working with Dynamic Particles . 79 Creating Fire and Smoke 80 The BB vs. the Crystal Ball: Using the Explode Modifier 94 Boids! . 101 Setting Up the Boids System 102 Working with Goals and Predators 102 Creating a Simple Flying Bird 106 Chapter 3 Getting Flexible with Soft Bodies and Cloth 109 Getting the Hard Facts on Soft Bodies . 110 Understanding Soft Body Basics 110 Baking 112 Animating a Spring with Soft Bodies 112 Using Force Fields and Collision 118 Working with Soft Bodies and Curves 121 Using Stress-Mapped Textures for Rubbery Surfaces 132 Getting Jiggly with Lattices . 139 Simulating Cloth and Clothing . 146 Putting Some Clothes on Mancandy 147 92801ftoc.qxd 5/14/08 10:00 AM Page xi Learning More about Cloth 156 Demolition! . 158 Chapter 4 Hair Essentials: The Long and Short of Strand Particles 165 Introducing Blender Hair . 166 Setting Up a Hair Simulation 168 Creating Clumping, Roughness, and Kink 176 Texture Mapping 180 Lighting and Rendering 182 A Trip to the Beauty Salon . 183 Preparing the Mesh 183 Editing Hair Particles 185 Releasing Your Inner Hairdresser 192 More Tips and Tricks for Controlling Hair 199 Soft Bodies and Hair 204 Other Uses for “Hair” Particles . 206 Chapter 5 Making a Splash with Fluids 213 Using the Blender Fluid Simulator. 214 Getting Started with Fluids 214 Inflow and Outflow 224 Time, Size, and Resolution 229 Particles 232 Obstacles and Animation 239 Animated Obstacles 242 Getting the Shot . 247 Strawberries and Milk 247 Bottle of Pop 254 Rushing Creek 259 Delving Further into Fluids . 266 Ipo Animation 266 Scripts and Exporting 266 Exploring Further Resources . 268 Chapter 6 Bullet Physics and the Blender Game Engine 271 The Blender Game Engine . 272 Getting Started with BGE 276 Using Ipos and Actions in BGE 282 Rigid Body Simulation and Ipos . 284 Baking Game Ipos 284 Frame Rate and Simulation Speed 285 Ctrl+Alt+Shift+P 288 Actor Parameters, Boundaries, and Hull Types 295 General Tips on Working with Bullet 305 Joints, Ragdolls, and Robots . 306 Using Rigid Body Joint Constraints 306 Using Generic (6DoF) Joints 309 Setting Up a Ragdoll Armature 310 Controlling an Armature 317 A Passive-Walking Robot 319 Further Resources . 324 92801ftoc.qxd 5/14/08 10:00 AM Page xii Chapter 7 Imitation of Life: Simulating Trees and Plants 325 The Blender Greenhouse: Creating Foliage with L-Systems and ngPlant . 326 L-Systems 327 ngPlant 337 Other Software 348 An Open Source Ivy Generator . 349 A Few More Points to Mention. 359 Tips for Creating an Outdoor Scene 359 The Importance of Observation 361 Appendix About the Companion CD 363 What You’ll Find on the CD . 364 Chapter Files 364 Blender 2.46 Software 364 System Requirements. 364 Using the CD. 364 Troubleshooting . 365 Customer Care 365 Index 367 92801c04.qxd 5/15/08 1:34 PM Page 165 Hair Essentials: The Long and Short of Strand Particles In the previous two chapters, you saw how to work with the Blender particle system to create dynamic particle effects and how to work with the soft body simulation functionality to enable 165 objects to behave flexibly and respond to forces ■ H AIR on them. This chapter draws on both of those E SSENTIALS chapters to introduce static particles, which are Blender’s way to create the kind of dense, : T strandlike effects needed for hair, fur, and grass. HE L ONG AND The new particle system is powerful and much easier to work with than the previous method S HORT OF of creating these effects. When you finish read- ing this chapter, you should be comfortable S TRAND using static particles to create everything from P synthetic turf to the long, flowing tresses of a ARTICLES damsel in distress. Chapter Contents 4 Introducing Blender hair A trip to the beauty salon Other uses for “hair”particles 92801c04.qxd 5/14/08 11:04 AM Page 166 Introducing Blender Hair Although the Blender Foundation’s open movie, Elephants Dream, was extremely suc- cessful as a demonstration of Blender’s potential as a production tool, the movie itself provoked mixed responses as entertainment. Some people felt it was too dark, too arty, too difficult to comprehend, and too focused on grizzled, ugly old dudes. As visually stunning as the film was, the hairstyles you see in Figure 4.1 weren’t exactly driving the ladies wild. Bald and scruffy had had its day, and a call rose up from the viewing pub- lic: Give us cute! Give us fluffy! And so the Blender Foundation, ever responsive to the wishes of the people—and noting that there happened to be a powerful new particle system already under development—took the call to heart. Thus the Peach project was born, with the mission to create a fun, irreverent comedy that would be, above all, furry.