Chia sẻ: Cong Thanh | Ngày: | Loại File: PDF | Số trang:30

lượt xem


Mô tả tài liệu
  Download Vui lòng tải xuống để xem tài liệu đầy đủ

CREATING GAME ART FOR 3D ENGINES- P1: Iwish to thank the editing team at Charles River Media (Emi Smith, Karen Gill, Jennifer Blaney, and Jenifer Niles) for their help in getting this book publish-ready. Thanks, too, to my technical editor, Mike Duggan. Also deserving recognition are the guys who make the Torque Game Engine available, GarageGames, who directly or indirectly made this book and the accompanying CD possible. In particular, I want to thank Joe Maruschak at GarageGames for the great articles and forum answers that have helped me and many others get a handle on this engine. I...

Chủ đề:


  2. Copyright 2008 Career & Professional Group, a division of Thomson Learning Inc. Published by Charles River Media, an Imprint of Thomson Learning Inc. All rights reserved. No part of this publication may be reproduced in any way, stored in a retrieval system of any type, or transmitted by any means or media, electronic or mechanical, including, but not limited to, photocopy, recording, or scanning, without prior permission in writing from the publisher. Publisher and General Manager, Charles River Media: Stacy L. Hiquet Associate Director of Marketing: Sarah O’Donnell Manager of Editorial Services: Heather Talbot Marketing Manager: Jordan Casey Marketing Assistant: Adena Flitt Project/Copy Editor: Karen A. Gill Technical Reviewer: Mike Duggan CRM Editorial Services Coordinator: Jennifer Blaney Interior Layout Tech: Judy Littlefield Cover Designer: Sherry Stinson Cover Images: Brad Strong CD-ROM Producer: Brandon Penticuff Indexer: Joan Green Proofreader: Sybil Fetter Charles River Media, Inc. 25 Thomson Place Boston, MA 02210 617-757-7900 617-757-7969 (fax) This book is printed on acid-free paper. Brad Strong. Creating Game Art for 3D Engines. ISBN-10: 1-58450-548-6 ISBN-13: 978-1-58450-548-8 eISBN-10: 1-58450-604-0 Library of Congress Catalog Card Number: 2007933886 3ds Max is a registered trademark of Autodesk, Inc. Photoshop is a registered trademark of Adobe Systems Incorporated. All other brand names and product names mentioned in this book are trademarks or service marks of their respective companies. Any omission or misuse (of any kind) of service marks or trademarks should not be regarded as intent to infringe on the property of others. The publisher recognizes and respects all marks used by companies, manufacturers, and developers as a means to distinguish their products. Printed in Canada 08 09 10 11 12 TC 10 9 8 7 6 5 4 3 2 1 Charles River Media titles are available for site license or bulk purchase by institutions, user groups, cor- porations, etc. For additional information, please contact the Special Sales Department at 800-347-7707. Requests for replacement of a defective CD-ROM must be accompanied by the original disc, your mail- ing address, telephone number, date of purchase, and purchase price. Please state the nature of the problem, and send the information to Charles River Media, Inc., 25 Thomson Place, Boston, MA 02210. CRM’s sole obligation to the purchaser is to replace the disc, based on defective materials or faulty workmanship, but not on the operation or functionality of the product.
  3. This book is dedicated to my wife, Åsa, who was an encouragement and a blessing from the time this book was just an idea until the final edit.
  4. This page intentionally left blank
  5. CONTENTS ACKNOWLEDGMENTS xvii ABOUT THE AUTHOR xix INTRODUCTION xxi CHAPTER 1 INTRODUCTION TO 3DS MAX 1 Examining the 3ds Max Interface 2 Using Drop-Downs and Panels 3 Adjusting Grid and Snap 4 Setting Preferences 4 Creating, Viewing, and Modifying Primitives 4 Using Viewport Controls 5 Modifying Primitives 5 Using Viewing Tools 6 Using Selection Windows 8 Box Modeling a Chair 8 Converting to an Editable Poly 9 Moving the Vertices of the Editable Poly 9 Maximizing the Viewport and Using Arc Rotate 11 Extruding the Legs of the Chair 11 Extruding the Back of the Chair 12 Creating the Arms of the Chair 12 Welding Vertices 14 Manipulating Vertices 14 Working with the Material Editor 15 Applying a Standard Material to an Object 15 Applying a Custom Material to an Object 16 v
  6. vi Contents Managing Files 18 Saving Your Work 18 Merging and Importing Files 18 Summary 18 CHAPTER 2 L OW P OLY M O D E L I N G 19 Creating Structurally Sound Models 20 Keeping a Low-Polygon Budget 21 Modeling a Simple Shape 22 Modeling a Health Patch 23 Welding Vertices with Weld Threshold 25 Creating a Pickup with Three Parts 26 Modeling a Power Charger 27 Modeling a Weapon 41 Creating a Template to Model By 42 Modeling with a Plane 43 Adding Symmetry to Mirror and Weld Vertices Simultaneously 47 Scaling Models to Fit the Torque Engine 54 Summary 55 CHAPTER 3 U N W R A P P I N G G AME A R T 57 Unwrapping the Oil Drum 58 Deciding Between Material Color and Object Color 58 Turning Off Smoothing 58 Applying a Cylindrical Map to the Model 59 Applying an Unwrap UVW Modifier 61 Applying a Normal Map 66 Applying a Utility Material 68 Correcting Flaws in the UVs 69 Moving UV Vertices to Improve the Mapping 71 Rendering Out the UV Template 72 Using Texporter: An Alternative for UV Rendering 73
  7. Contents vii Unwrapping the Weapon 75 Mirroring and Aligning Normal-Mapped UVs 75 Normal Mapping the Cooling Fins 78 Correcting the UVs at the Edges of the Weapon 79 Breaking and Scaling UVs 80 Unwrapping the Ammo Box 82 Unwrapping the Power Charger 84 Applying a Planar Map 85 Moving UV Vertices to Improve the Map 85 Using a Planar Map for More Complex Models 86 Unwrapping the Health Patch 90 Summary 94 CHAPTER 4 T E X T U R I N G G AME A R T 95 Texturing Considerations 96 Using the Appropriate Equipment 96 Using Digital Photos for Textures 96 Making the Lighting Consistent 96 Creating Textures from Scratch 97 Creating in Powers of Two 97 Working with Photoshop 97 Texturing the Oil Drum 101 Pushing Pixels with the Liquify Tool 101 Using Offset to Make the Texture Wrap 102 Repairing Seams with the Clone Stamp Tool 102 Reflection Mapping in Photoshop 104 Defining a Reflective Oil Drum Material in 3ds Max 105 Assigning Smoothing Groups to the Oil Drum 107 Texturing the Health Patch 107 Creating Textured Steel 107 Applying a Layer Style to Create Raised Steel Panels 107 Using Layer Masking Instead of Erase 108 Animating a Pulsing Light Using an IFL Material 109
  8. viii Contents Animating a Transparent Exhaust Material 109 Applying the Materials in 3ds Max 111 Texturing the Weapon 112 Texturing the Power Charger 115 Creating Concrete Using Filters 115 Creating Ancient Metal 117 Modifying Smoothing Groups for the Power Charger 118 Texturing the Ammo Box 119 Summary 122 CHAPTER 5 A N I M A T I N G G AME A R T 123 Understanding Animation Basics 124 Creating Keyframes 124 Creating a Loop 125 Adjusting Key Tangencies 126 Animating a Simple Shape 127 Animating the Health Patch 128 Adjusting Pivot Points with Affect Pivot Only 128 Creating Parent-Child Relationships 129 Animating the Weapon 129 Summary 132 CHAPTER 6 E X P O R T I N G G AME A R T 133 Exporting Game Art—Overview 134 Export Components 134 Folder Structure 134 Static Shapes Folders 135 Health Patches Folder 135 Weapons Folder 135 Bounds Boxes 135 Markers, or “Dummy Objects” 135 Hierarchy 135 Pickup Rotation 136 Animations 136
  9. Contents ix Setting Up for 3ds Max and Torque 136 Installing the DTS Exporter 136 Setting Up Torque for First Person Shooter 137 Deleting CS.DSO Files So That CS Files Will Be Read 137 Entering the Torque Editor 137 Saving and Renaming Missions 138 Checking the Torque Console Window 138 Previewing Game Art in Torque Show Tool Pro 139 Setting Up and Exporting the Simple Shape 140 Accessing the DTS Export Utilities 140 Setting Up the Hierarchy of a Simple Oil Drum 140 Exporting the Simple Shape 141 Inserting the Simple Shape into the Game 141 Applying Levels of Detail 143 Causing Collisions 145 Setting Up and Exporting the Health Patch 145 Colliding with Health Objects 146 Embedding Sequence Objects 146 Inserting the Health Patch into the Mission 148 Scripting Health Patch Animation 148 Analyzing the Characteristics of a Health Patch 149 Setting Up and Exporting Ammo 150 Setting Up and Exporting Weapons 151 Weapons Components 152 The Projectile 152 A Simple Weapon Hierarchy 152 Preparing and Exporting Weapon Animations 152 Scripting for Weapons and Ammo 153 Producing Simple Shape Animations 159 Creating the Simple Shape Datablock 159 Editing Game.cs to Call Your Script 161 Troubleshooting 162 The Shape Does Not Appear in the Game 162 The Texture Does Not Show Up in the Game 162 Weapon View in First Person Mode Is Incorrectly Offset 162 Summary 163
  10. x Contents CHAPTER 7 CHARACTER MODELING 165 Modeling a Character—Overview 166 Planning for Unwrapping the Model 166 Acknowledging Character Polygon Limitations 166 Setting Up Templates in Photoshop 166 Posing the Character 166 Sketching a Front and Right-Side View of the Character 167 Scanning and Creating Two Matching Images in Photoshop 168 Turning Down the Brightness and Saving the Images 168 Setting Up the Template Planes in 3ds Max 169 Setting Up Units 169 Creating Template Planes 169 Orienting the Template Planes 169 Snapping the Template Planes to the Origin 170 Applying the Templates to the Planes 170 Freezing the Templates 171 Modeling the Astronaut Character Mesh 171 Starting with a Box 171 Making the Modeling Process Easier by Adjusting Properties 171 Adding Symmetry to Speed the Modeling Process 172 Extruding the Arms and Legs 172 Moving and Adding Vertices as Necessary 172 Adding Edges with Row, Loop, and Connect 174 Adding Volume and Shape to the Mesh 175 Using Edge Loops 175 Planning for Movement 176 Modeling the Hands 177 Merging and Scaling the Hand to Fit the Body 178 Modeling the Head and Face 180 Finishing Off the Head with a Geosphere 181 Converting to Editable Mesh and Turning Edges 182 Adding Accessory Meshes 183 Creating a Helmet with Detached Polygons 184 Adding a Shell Modifier 184 Modeling a Robot with Multiple Meshes 186 Summary 187
  11. Contents xi CHAPTER 8 CHARACTER UNWRAPPING 189 Unwrapping a Character—Overview 190 Unwrapping Before You Rig the Model 190 Understanding the Impact of Stray Vertices 190 Removing Stray Vertices 190 Unwrapping the Hands with a Planar Map and Adding Them to the Body 191 Unwrapping the Body with a Normal Map 194 Breaking and Overlapping UVs 195 Breaking and Reorganizing UVs 195 Adjusting the UVs on the Body 196 Unwrapping the Character’s Face 197 Adjusting the UVs on the Face 197 Unwrapping with the Pelt Map 198 Creating a Character UV Template 200 Unwrapping the Helmet 201 Unwrapping a Component Mesh 201 Unwrapping with Multiple Material IDs 202 Creating a Multi/Sub-Object Material 202 Assigning Mesh IDs to Polygons 202 Accessing the Selection Sets in the Edit UVWs Dialog Box 203 Saving, Loading, and Combining UVs 204 Baking the Texture into the Mesh 205 Summary 205 CHAPTER 9 CHARACTER TEXTURING 207 Texturing the Astronaut 208 Setting Up in Photoshop 208 Using the Same Smoothing Group 208 Creating the Astronaut’s Spacesuit Texture 208 Using a Layer Style to Create Raised Pixels 209 Using a Layer Mask to Draw the Ribs 211 Texturing the Astronaut’s Helmet 211 Texturing the Astronaut’s Face 211 Texturing the Robot 213 Creating a Base Metal Texture 213
  12. xii Contents Creating Panels 214 Creating Rivets 214 Creating Scratched and Peeling Paint 215 Modeling Textures in 3ds Max 217 Troubleshooting 219 Misaligned Unwrap 219 Distorted Textures 219 Summary 219 C H A P T E R 10 CHARACTER RIGGING 221 Rigging—Overview 222 Deciding Between Bones and Biped 222 Setting Up the Mesh as a 3D Template 222 Making a Biped 223 Modifying the Parameters of a Biped After You’ve Created It 223 Understanding the Biped 223 Understanding the Biped Center of Mass (COM) 224 Rotating the Biped 224 Moving the Biped 225 Minimizing Vertex Collapse 225 Minimizing Collapsed Vertices by Modeling 226 Minimizing Collapsed Vertices by Prerotating Biped Bones 226 Minimizing Collapsed Vertices by Using Helper Bones 226 Minimizing Deformations by Using the Joint Angle Deformer 230 Fitting the Biped to the Character Mesh 230 Scaling the Pelvis and Clavicles of the Biped 231 Scaling and Rotating the Legs and Arms of the Biped 231 Aligning the Biped to the Character Mesh from the Side View 231 Saving the Figure File 231 Examining the Skinning Process 232 Applying a Skeleton via Skin or Physique 232 Ensuring You’re Ready for Skinning 232 Applying the Skin Modifier to the Character Mesh 233 Deciding Which Bones to Add to the Skin Modifier 233 Adjusting the Envelope 233
  13. Contents xiii Assigning Weights to Vertices with Absolute Effect 237 Assigning Weights to Vertices with the Weight Tool 238 Moving and Rotating Bones to Check Vertex Assignments 241 Understanding Forward Kinematics and Inverse Kinematics 241 Avoiding the Chewing Gum Effect 241 Changing the Skeleton While Skinning 242 Looking for Vertex Collapse 243 Keyframing the Biped to Check Mesh Deformation 243 Creating Optional Controller Objects 244 Rigging a Robot 244 Using the Default Player Biped with a Custom Mesh 245 Taking Advantage of Using the Kork Player Biped with Your Character Mesh 246 Dealing with the Disadvantages of Using the Kork Player Biped with Your Mesh 246 Stripping Down the Player.max File 246 Applying the Skin Modifier to Your Mesh but Using the Kork Player Biped Bones 246 Minimizing Vertex Collapse with the Kork Player Biped 247 Combining Bones with Biped 248 Summary 249 C H A P T E R 11 C H A R A C T E R A NIMATION 251 Implementing Character Animation Concepts 252 Applying Counterpose 252 Avoiding Twins or Twinning 252 Using Arcs for Natural Movement 252 Applying Secondary Motion 252 Exaggerating Movement 253 Planning the Animation Cycles 253 Distinguishing Animation Methods 253 Choosing Between Full Body, Lower Body, and Blend Animation 253 Exporting All Animations Together or Separately 254 Choosing Between Biped and Bones Animation 254 Animating with Biped 255 Dealing with Nonintuitive Dependencies in the Biped Skeletal System 255 Creating and Importing BIP Files 255
  14. xiv Contents Creating the Root Pose 256 Animating the Root Cycle 257 Animating a Run Cycle 258 Keyframing the Biped to Run 258 Constraining the Cam Marker 263 Viewing and Adjusting Trajectories 264 Improving the Run Cycle 264 Animating a Back (Backwards Run) Cycle 265 Animating a Side (Strafe) Cycle 265 Animating Jump, Fall, and Land Cycles 266 Animating the Death Fall 266 Summary 266 C H A P T E R 12 CHARACTER EXPORTING 269 Exporting Character Shape (DTS) Files 270 Required Markers for Character Export 270 Checklist for Exporting a Simple Character 270 Position of the Character’s Markers 271 The Character Hierarchy 271 Bounding Box 272 Levels of Detail 273 MountPoints 275 Additional Meshes and Collisions 275 Config File 276 Export of the DTS Shape 277 Exporting Character Animation (DSQ) Files 278 Sequence Object Setup 279 Footprints and Foot Sounds 280 Export of the DSQ Animation 280 Using the Torque Show Tool Pro 281 Scripting Characters 282 The Player.cs Animation Script 282 The Player.cs Datablock Script 284 Scripting for Different Character Meshes in the Game 284
  15. Contents xv Troubleshooting 287 Assertion Failed on Skin Object 287 Improperly Assigned Vertices 287 Character Is Invisible in the Game 287 Character Is Not Animating 288 Cannot Collapse bip01 L Finger00 Because It Is a Bone 288 Helper Bones and Proxy Objects Are Distorted in the Animation Files 288 Weapon Is Invisible or Intermittently Visible in First Person Mode 288 Weapon Is Pointed the Wrong Way or Is Otherwise Misaligned 289 Footprints Are Not Visible in the Game 289 Character Stutters Forward and Backward During Run 289 Character Does Not Fall Down in Death Cycle 289 Assertion Error During Vertex Merge 290 Character Does Not Complete Animation 290 Summary 290 APPENDIX A O N T H E C OMPANION CD-ROM 293 INDEX 295
  16. This page intentionally left blank
  17. ACKNOWLEDGMENTS I wish to thank the editing team at Charles River Media (Emi Smith, Karen Gill, Jennifer Blaney, and Jenifer Niles) for their help in getting this book publish-ready. Thanks, too, to my technical editor, Mike Duggan. Also deserving recognition are the guys who make the Torque Game Engine available, GarageGames, who directly or indirectly made this book and the accompanying CD possible. In particular, I want to thank Joe Maruschak at GarageGames for the great articles and forum answers that have helped me and many others get a handle on this en- gine. I also want to thank Autodesk for a great product (3ds Max) and for the experience I gathered while there; thank you David Koel for making me a better AE. Cuneyt Ozdas deserves recognition for writing Texporter, the handy UV renderer. Thanks also to Matt Summers for writing the Dark Industries exporter, and to Sam Bacsa for writing Codeweaver, which helped me to work through some of the scripting challenges. Fi- nally, thanks to Steve Smith at the Art Institute of Colorado for freely sharing his knowledge while I taught there. xvii
  18. This page intentionally left blank
  19. ABOUT THE AUTHOR B rad Strong, a former Autodesk application engineer, has more than 18 years of experience using and teaching digital design soft- ware in the Rocky Mountain region. He holds a master’s in computer information systems from Denver University/University Col- lege, where his thesis and capstone project was on game-based learning; a master’s in management from the University of Phoenix, where his thesis was on effective CAD utilization; and a bachelor’s in art from the University of Colorado at Denver. Brad has developed and taught a range of courses on programming, art, and game development at art and technical colleges in the Colorado area. Most recently, he taught 3D modeling, materials and lighting, 3D animation, and online game development for the Art Institute of Col- orado. Since 2002, he has been developing 3D learning games. He is the president of 3dCognition, a game-based learning development studio, based in Karlskoga, Sweden. The 3dCognition Web site can be found at When he’s not working, Brad enjoys theology, philosophy, bass guitar, and composing fusion-lounge-gospel music with his wife. xix
Đồng bộ tài khoản