Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
Team LRN
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
This page intentionally left blank
Team LRN
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
3D
Game Programming
All in One
Kenneth C. Finney
Team LRN
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
SVP, Course Professional, Trade,
Reference Group:
Andy Shafran
Publisher:
Stacy L. Hiquet
Senior Marketing Manager:
Sarah O’Donnell
Marketing Manager:
Heather Hurley
Manager of Editorial Services:
Heather Talbot
Acquisitions Editor:
Mitzi Koontz
Associate Marketing Manager:
Kristin Eisenzopf
Series Editor:
André LaMothe
Developmental Editors:
Reaction and Reaction Engine SDK are trademarks of Monster Studios.
UVMapper 0.25—copyright ©1998-2002 Stephen L Cox, All rights
reserved. ThinkTanks is a trademark of BraveTree Productions, LLC. Orbz
is a trademark of Mind Vision Software. Marble Blast Gold is a trademark
of GarageGames. MilkShape 3D is a trademark of chUmbaLum sOft.
All other trademarks are the property of their respective owners.
Important: Course PTR cannot provide software support. Please contact
the appropriate software manufacturer’s technical support line or Web
site for assistance.
Course PTR and the author have attempted throughout this book to
distinguish proprietary trademarks from descriptive terms by following
the capitalization style used by the manufacturer.
Information contained in this book has been obtained by Course PTR
from sources believed to be reliable. However, because of the possibility
of human or mechanical error by our sources, Course PTR, or others, the
Publisher does not guarantee the accuracy, adequacy, or completeness of
any information and is not responsible for any errors or omissions or the
results obtained from use of such information. Readers should be partic-
ularly aware of the fact that the Internet is an ever-changing entity. Some
facts may have changed since this book went to press.
Educational facilities, companies, and organizations interested in multi-
ple copies or licensing of this book should contact the publisher for
quantity discount information. Training manuals, CD-ROMs, and por-
tions of this book are also available individually or can be tailored for
specific needs.
ISBN: 1-59200-136-X
Library of Congress Catalog Card Number: 2004090733
Printed in the United States of America
04 05 06 07 08 BH 10 9 8 7 6 5 4 3 2 1
Course PTR, a division of Course Technology
the gentleman—I salute you, !S. Then there are, in no particular order: AceTW, his evil
twin Malfunction, Strata, Spector, Roadkill, Midnight, Oz Mal, Deadbolt, Insomniac,
Checkfire, Norway, Animal, Qdad, MickyD, Buster, Major Chip Hazard, Pirate, Kotch, C2,
FF6, IRS Agent, and Kdawg—I mustn’t neglect to mention Dr. Evil and the great work he
vi
Acknowledgments
Team LRN
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
Acknowledgments vii
and his gang are doing with the TXP stuff. Last, but certainly not least, Jim, The Nailer, the
epitome of the Online Game Player, and an all around great guy. I hope that everything
works out, Jim.
Along the way, there have been many others in various places that deserve some mention:
KILLER and his gang, who do what cornered rats do best—fight back. Many other game
developers can learn a thing or two about hard work from those guys. Onchas, Cowboy,
Badger, and the rest of the “Allies”—keep up the good work. Same with you “Axis” play-
ers (except that your days are numbered!). Also a hearty !S to the Playnet forum denizens
who opened a second front as soon as the war started (Teh?).
I’m sure I’ve forgotten to acknowledge someone, and I’ll probably get e-mails to that
effect, but that’s the risk one embraces.
Regards,
CERDIP
Team LRN
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
viii
K
ENNETH
C. F
INNEY
is the Principal Software Engineer at Wilkes Associates, Inc. in the
Chapter 1
Introduction to 3D Game Development . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1
Chapter 2
Introduction to Programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .31
Chapter 3
3D Programming Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .89
Chapter 4
Game Programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .123
Chapter 5
Game Play . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .157
Chapter 6
Network . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .205
Chapter 7
Common Scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .235
Chapter 8
Introduction to Textures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .275
Chapter 9
Skins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .309
Chapter 10
Creating GUI Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .335
Chapter 11
Structural Material Textures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .351
x
Contents at a Glance
Team LRN
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.