Physics for Game Programmers

Total Page:16

File Type:pdf, Size:1020Kb

Physics for Game Programmers Physics for Game Programmers GRANT PALMER www.allitebooks.com Physics for Game Programmers Copyright © 2005 by Grant Palmer All rights reserved. No part of this work may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, recording, or by any information storage or retrieval system, without the prior written permission of the copyright owner and the publisher. ISBN (pbk): 1-59059-472-X Printed and bound in the United States of America 9 8 7 6 5 4 3 2 1 Trademarked names may appear in this book. Rather than use a trademark symbol with every occurrence of a trademarked name, we use the names only in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the trademark. Lead Editor: Tony Davis Technical Reviewers: Alan McLeod, Jack Park Editorial Board: Steve Anglin, Dan Appleman, Ewan Buckingham, Gary Cornell, Tony Davis, Jason Gilmore, Jonathan Hassell, Chris Mills, Dominic Shakeshaft, Jim Sumser Assistant Publisher: Grace Wong Project Manager: Laura E. Brown Copy Manager: Nicole LeClerc Copy Editor: Ami Knox Production Manager: Kari Brooks-Copony Production Editor: Kelly Winquist Compositor: Susan Glinert Proofreader: Liz Welch Indexer: John Collin Artist: Kinetic Publishing Services, LLC Cover Designer: Kurt Krames Manufacturing Manager: Tom Debolski Distributed to the book trade in the United States by Springer-Verlag New York, Inc., 233 Spring Street, 6th Floor, New York, NY 10013, and outside the United States by Springer-Verlag GmbH & Co. KG, Tiergartenstr. 17, 69112 Heidelberg, Germany. In the United States: phone 1-800-SPRINGER, fax 201-348-4505, e-mail [email protected], or visit http://www.springer-ny.com. Outside the United States: fax +49 6221 345229, e-mail [email protected], or visit http://www.springer.de. For information on translations, please contact Apress directly at 2560 Ninth Street, Suite 219, Berkeley, CA 94710. Phone 510-549-5930, fax 510-549-5939, e-mail [email protected], or visit http://www.apress.com. The information in this book is distributed on an “as is” basis, without warranty. Although every precaution has been taken in the preparation of this work, neither the author(s) nor Apress shall have any liability to any person or entity with respect to any loss or damage caused or alleged to be caused directly or indirectly by the information contained in this work. The source code for this book is available to readers at www.apress.com in the Downloads section. www.allitebooks.com This book is dedicated to my wonderful wife, Lisa. www.allitebooks.com Contents at a Glance About the Author . xvii About the Technical Reviewers . xix Acknowledgments . xxi Introduction . xxiii CHAPTER 1 Adding Realism to Your Games . 1 CHAPTER 2 Some Basic Concepts . 5 CHAPTER 3 Basic Newtonian Mechanics . 21 CHAPTER 4 Basic Kinematics . 49 CHAPTER 5 Projectiles . 83 CHAPTER 6 Collisions . 139 CHAPTER 7 Sports Simulations . 167 CHAPTER 8 Cars and Motorcycles . 211 CHAPTER 9 Boats and Things That Float . 245 CHAPTER 10 Airplanes . 275 CHAPTER 11 Rockets and Missiles . 319 CHAPTER 12 The Physics of Solids . 351 CHAPTER 13 Explosions . 371 CHAPTER 14 Lasers . 385 CHAPTER 15 Probabilistic and Monte Carlo Simulations . 403 ■INDEX . 423 v www.allitebooks.com Contents About the Author . xvii About the Technical Reviewers . xix Acknowledgments . xxi Introduction . xxiii ■CHAPTER 1 Adding Realism to Your Games . 1 Physics Will Keep Your Games from Looking Fake . 1 Adding Physics-Based Realism Is Easier Than You Might Think . 2 Adding Physics Won’t Affect Game Performance . 3 Knowing Some Physics Will Make You a Better Game Programmer . 4 Let’s Add Some Realism to Your Games . 4 ■CHAPTER 2 Some Basic Concepts . 5 Systems of Units . 6 Scientific Notation . 7 Summation Notation . 8 Greek Letters . 8 Coordinate Systems and Frames of Reference . 9 Scalars and Vectors . 10 Computing the Magnitude of a Vector . 11 The Unit Vector . 11 Vector Cross Product . 12 Matrices . 12 Matrix Multiplication. 13 Rotation Matrices . 13 Derivatives . 15 Differential Equations . 18 Summary . 19 vii www.allitebooks.com viii ■CONTENTS ■CHAPTER 3 Basic Newtonian Mechanics . 21 A Short Biography of Sir Isaac Newton . 22 Newton’s First Law of Motion: Inertia. 22 Newton’s Second Law of Motion: Force, Mass, and Acceleration . 23 Newton’s Third Law of Motion: Equal and Opposite Forces . 24 Force Vector . 24 Types of Forces . 25 Gravitational Force . 25 Friction . 31 Centripetal Force. 38 Force Balances and Force Diagrams . 39 Work . 41 Energy . 43 Kinetic Energy . 43 Potential Energy . 44 Other Forms of Energy . 44 Conservation of Energy . 45 Power . 45 Summary . 46 Answers to Exercises . 46 ■CHAPTER 4 Basic Kinematics . 49 Translational Motion . 49 The Relationship Between Force, Acceleration, Velocity, and Location . 50.
Recommended publications
  • Behind Every Great Artist Is an Extraordinary Pipeline
    AUTODESK® INteGRated CReatiVE ENVIRONMENT Build a Superior Production Pipeline Wire makes it extremely efficient for us to exchange material In addition to out-of-the-box solutions, Autodesk offers customized consulting between our Flame and Smoke workstations because it services to help you establish the scalable workflows and framework to easily allows us to transfer clip sequences along with their edits manage data throughout your project lifecycle. and other valuable metadata—faster than real time. Autodesk Consulting has a specialized, in-house response team with deep Jake Parker, Senior Flame Artist & Visual Effects Supervisor, Crash & Sue’s industry experience and knowledge that can provide expertise for a wide range of requirements such as: Behind every great artist • Development of Customized Applications • Strategic Pipeline Analysis and Data Management • Customization and Consulting for 3D engagements Less Work. • Customized Training is an extraordinary pipeline • Accelerated Product Development • Certified Installation and Calibration We’ll create complete business solutions tailored specifically for your business. Get Connected Today Eliminate risks and improve return on software, system and storage expenditures. Autodesk workflow solutions optimize your production pipeline and result in significantly improved return on investment, enhanced digital asset migration, and enterprise-class data management solutions. For more information about Autodesk workflow solutions, visit www.autodesk.com/me. North America: +1-800-869-3504 International: +415-507-4461 Email: [email protected] Find a reseller: www.autodesk.com/reseller 000000000000117371 Autodesk, Lustre, Inferno, Flame, Flint, Fire, Smoke, Toxik, Combustion, Maya, 3ds Max, MotionBuilder, VIZ, Backdraft Conform, Burn, Backburner, Cleaner, FBX, Incinerator, Stone, Wire, and Wiretap are registered trademarks or trademarks of Autodesk, Inc./Autodesk Canada Co.
    [Show full text]
  • IBC 2000: Produkte
    www.film-tv-video.de Seite 1 Messebericht IBC 2000: Produkte Die IBC ist jedes Jahr Marktplatz neuer und interessanter Produkte. www.film- tv-video.de hat die interessantesten herausgefiltert. TEXT: C. GEBHARD, G. VOIGT-MÜLLER • BILDER: NONKONFORM, ARCHIV ist bislang vor allem durch anbieten. Zur Auswahl stehen SGI Octane seine Software-Plug-Ins für MXE und SGI Octane 2 auf der Unix-Seite 5DEffektsysteme von Discreet und aus dem Windows-NT-Lager SGI oder Quantel bekannt. Mit dem System 330/550 und in Kürze auch die SGI Cyborg S präsentiert der britische Zx10Workstation, die SGI von Intergraph Hersteller nun ein eigenes übernommen hat. Komplettsystem, das die wichtigsten Mit dem Komplettsystem soll ein Nachbearbeitungsfunktionen beherrscht, hochauflösender 16:9-Monitor und ein A3- zudem aber auch als Vermittler zwischen Wacom-Tablett ausgeliefert werden. Der Systemen von Avid, Discreet und Quantel Nettopreis für ein Komplettsystem soll fungieren kann – etwa durch Format-/File- zwischen 30.000 und 60.000 Dollar liegen, Konvertierungen. Die Cyborg-S-Software geplanter Auslieferungsbeginn ist der sieht auf den ersten Blick aus wie eine Dezember 2000. Mischung aus Discreet- und Quantel- Im kommenden Jahr soll es auch eine Software, offenbar haben sich die Version von Cyborg S geben, die auf dem Entwickler von 5D die Systeme von neuen Quantel-System iQ läuft. Quantel und Discreet intensiv angesehen und für sich die interessantesten Parts Avid gab während der IBC die herausgesucht. Die wichtigsten Übernahme des Herstellers Pluto bekannt. Funktionsmodule von Cyborg S im Damit erweitert Avid seine Produktpalette Überblick: Create, Paint & Rotoscoping, um den wichtigen Bereich der Server- und Tracker & Stabilizer, 5D Time Twister und Speichertechnologie und wird künftig die Primatte Chromakeyer.
    [Show full text]
  • Curriculum & Syllabus
    REGULATIONS 2016 M Scheme REGARDING ADMISSION, EVALUATION, AWARD OF DIPLOMA UNDER ACADEMIC AUTONOMY APPROVED IN THE 40TH ACADEMIC BOARD DIPLOMA COURSES IN ENGINEERING (SIX-SEMESTER REGULAR, SEVEN-SEMESTER SANDWICH FULL-TIME AND EIGHT SEMESTER PART-TIME) 1. CANDIDATES FOR ADMISSION 1.1 AGE LIMIT Candidates for admission into the first semester of the six-semester Regular, seven-semester Sandwich, eight- semester Part-Time Diploma Courses and to the third semester Regular Diploma courses under Lateral Entry shall satisfy the age limit as prescribed by the Directorate of Technical Education. 1.2 QUALIFICATIONS 1.2.1. Candidates seeking admission into Full-Time and Part-Time Diploma Courses shall be required to have passed X standard examination of the State Board of Education, Tamil Nadu or any other equivalent examination already recognized by the Directorate of School Education Board, Tamilnadu with eligibility for admission to First year of Higher Secondary School in Tamil Nadu 1.2.2. Candidates seeking admission to the Second Year (III Semester) of Regular Diploma Courses under Lateral Entry shall be required to have passed the Higher Secondary Certificate (HSC) Examination ( Vocational) or 2 year Industrial Training Institute (ITI) Certificate Examination after passing X Std. Examination of State Board of Education as prescribed by the Directorate of Technical Education. 1.3 ELIGIBILITY Candidates seeking admission shall satisfy the eligibility conditions such as subjects, marks, number of attempts etc, as prescribed by the Directorate of Technical Education, Tamil Nadu. 2. DURATION OF COURSE The duration for the Full-Time Regular Diploma Course shall be 6 consecutive semesters and for the Sandwich Diploma Course shall be 7 consecutive semesters and spread over 3 and 3 ½ academic years respectively, and for Part-Time Diploma Course shall be 8 consecutive semesters spread over 4 academic years.
    [Show full text]
  • Main Page 1 Main Page
    Main Page 1 Main Page FLOSSMETRICS/ OpenTTT guides FLOSS (Free/Libre open source software) is one of the most important trends in IT since the advent of the PC and commodity software, but despite the potential impact on European firms, its adoption is still hampered by limited knowledge, especially among SMEs that could potentially benefit the most from it. This guide (developed in the context of the FLOSSMETRICS and OpenTTT projects) present a set of guidelines and suggestions for the adoption of open source software within SMEs, using a ladder model that will guide companies from the initial selection and adoption of FLOSS within the IT infrastructure up to the creation of suitable business models based on open source software. The guide is split into an introduction to FLOSS and a catalog of open source applications, selected to fulfill the requests that were gathered in the interviews and audit in the OpenTTT project. The application areas are infrastructural software (ranging from network and system management to security), ERP and CRM applications, groupware, document management, content management systems (CMS), VoIP, graphics/CAD/GIS systems, desktop applications, engineering and manufacturing, vertical business applications and eLearning. This is the third edition of the guide; the guide is distributed under a CC-attribution-sharealike 3.0 license. The author is Carlo Daffara ([email protected]). The complete guide in PDF format is avalaible here [1] Free/ Libre Open Source Software catalog Software: a guide for SMEs • Software Catalog Introduction • SME Guide Introduction • 1. What's Free/Libre/Open Source Software? • Security • 2. Ten myths about free/libre open source software • Data protection and recovery • 3.
    [Show full text]
  • Silhouette 5 User Guide • • About This Guide• 2 • • • ABOUT THIS GUIDE
    Silhouette 5 User Guide • • About this Guide• 2 • • • ABOUT THIS GUIDE This User Guide is a reference for Silhouette and is available as an Acrobat PDF file. You can read from start to finish or jump around as you please. Copyright No part of this document may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying and recording, for any purpose without the express written consent of SilhouetteFX, LLC. Copyright © SilhouetteFX, LLC 2014. All Rights Reserved June 23, 2014 About Us SilhouetteFX brings together the unbeatable combination of superior software designers and visual effects veterans. Add an Academy Award for Scientific and Technical Achievement, 3 Emmy Awards and experience in creating visual effects for hundreds of feature films, commercials and television shows and you have a recipe for success. • • • Silhouette User Guide• • • • • About this Guide• 3 • • • • • • Silhouette User Guide• • • • • Table of Contents• 4 • • • Table of Contents • • • • • • About this Guide.............................................................................. 2 Copyright ...................................................................................... 2 About Us....................................................................................... 2 Table of Contents............................................................................. 4 Silhouette Features.......................................................................... 11 Roto.............................................................................................
    [Show full text]
  • Contents Suscipit, Vicis Praesent Erat 1
    EYE ON IT QUALIFICATIONS PACK - OCCUPATIONAL STANDARDS FOR MEDIA AND Current Industry ENTERTAINMENT INDUSTRY Trends Contents Suscipit, vicis praesent erat 1. Introduction and Contacts..…………………P.1 feugait epulae, validus indoles duis enim consequat genitus at. 2. Qualifications Pack……….………………….… P.2 Sed, conventio, aliquip 3. OS Units……………………..…….………………..P.2 accumsan adipiscing augue What are 4. Glossary of Key Terms …………………………P.3 blandit minim abbas oppeto Occupational commov. Standards(OS)? 5. Annexure: Nomenclature for QP & OS….P.6 Aptent nulla aliquip camur ut OS describe what Enim neo velit adsum odio, consequat aptent nisl in voco multo, in commoveo quibus individuals need to do, know and consequat. Adipsdiscing magna premo tamen erat huic. Occuro understand in jumentum velit iriure obruo. damnum uxor dolore, ut at praemitto opto pneum. Aptent nulla aliquip camur ut si sudo, opes feugiat iriure order to carry out Introduction a particular job consequat lorem aptent nisl magna validus. Sino lenis vulputate, jumentum velitan en iriure. Loquor, role or function Qualifications Pack-Compositor valetudo ille abbas cogo saluto vulputate meus indoles iaceo, ne quod, esse illum, letatio lorem secundum, dolus demoveo conventio. Letalis nibh iustum OS are SECTOR: INFORMATION TECHNOLOGY- INFORMATION TECHNOLOGY ENABLED SERVICES performance SECTOR: MEDIA AND ENTERTAINMENT interddfico proprius. In consequat os transverbero bene, erat vulpu (IT-ITES)ces Helpdesk Attendant quadfse nudflla magna. Aptent nulla tate enim esse si sudo erat. standards
    [Show full text]
  • Animated Impressionism with Adobe After Effects
    Animated Impressionism with Adobe After Effects This tutorial covers a technique for animating paint strokes applied to a still image so that it appears to be a work of impressionistic art. Adobe After Effects is the software application used in this demonstration, but you can take the method outlined here and apply it to your own compositing application. Parts of the tutorial, however, will only work in Adobe After Effects and Autodesk Combustion. To achieve the desired effects as shown in the video above, the following plugins from RE:Vision Effects should be installed into your compositing application. Click the plugin names to download them from the RE:Vision Effects website: SmoothKit 2.0 RE:Map VideoGogh 3.0 You should have an intermediate understanding of Adobe After Effects in order to follow the steps outlined in this tutorial. Following along requires the use of the files found in the project archive that you can download from the link below. Unzip the archive file and open the Adobe After Effects CS3 project file to begin. Once open, within the project panel, you will find finalized versions of the compositions that you will eventually build by performing the steps in the tutorial. Download project files for the Animated Impressionism tutorial | 1.2 MB | ZIP Archive The first part of the tutorial covers the technique in its most basic form. The sections in the first part show how to define a direction map for the paint strokes to follow, how to create a map for the stroke velocities, and the effects design.
    [Show full text]
  • After Effects, Or Velvet Revolution Lev Manovich, University of California, San Diego
    2007 | Volume I, Issue 2 | Pages 67–75 After Effects, or Velvet Revolution Lev Manovich, University of California, San Diego This article is a first part of the series devoted to INTRODUCTION the analysis of the new hybrid visual language of During the heyday of postmodern debates, at least moving images that emerged during the period one critic in America noted the connection between postmodern pastiche and computerization. In his 1993–1998. Today this language dominates our book After the Great Divide, Andreas Huyssen writes: visual culture. It can be seen in commercials, “All modern and avantgardist techniques, forms music videos, motion graphics, TV graphics, and and images are now stored for instant recall in the other types of short non-narrative films and moving computerized memory banks of our culture. But the image sequences being produced around the world same memory also stores all of premodernist art by the media professionals including companies, as well as the genres, codes, and image worlds of popular cultures and modern mass culture” (1986, p. individual designers and artists, and students. This 196). article analyzes a particular software application which played the key role in the emergence of His analysis is accurate – except that these “computerized memory banks” did not really became this language: After Effects. Introduced in 1993, commonplace for another 15 years. Only when After Effects was the first software designed to the Web absorbed enough of the media archives do animation, compositing, and special effects on did it become this universal cultural memory bank the personal computer. Its broad effect on moving accessible to all cultural producers.
    [Show full text]
  • Mocha® V5.5.2 Release Note
    mocha® v5.5.2 Release Note Table of Contents Introduction ................................................................................................................ 2 Build notes ................................................................................................................ 2 New Features in mocha Pro 5.5.2 ............................................................................ 2 New Features in mocha VR 5.5.2 ............................................................................ 3 Fixed issues since 5.5.1 ........................................................................................... 3 Known Issues .......................................................................................................... 15 Hardware Requirements ......................................................................................... 80 Recommended Hardware ................................................................................ 80 Minimal Requirements ..................................................................................... 81 Software Requirements for mocha Standalone ...................................................... 81 Operating System ............................................................................................ 81 Software Requirements for mocha Plugins ............................................................. 81 Host Applications ............................................................................................. 81 Operating System ...........................................................................................
    [Show full text]
  • (Open Source[Free]) Software List
    (open source[free]) software list People are generally well informed on commercial software, even applications they may not use on a day to day basis, such as Adobe Photoshop. Often however, you will want to do something you do not have the software for, like fake a UFO sighting, and the software you ideally need is far too expensive to buy for the infrequent times you use it. Photoshop costs around £400 and say you are going to use it to fake the UFO and not much else, by the time you use it again there will be a newer version out. Probably not worth the money. Similarly say you have 3 computers in your house. New desktop, bedroom computer and laptop. Some high end software licences will allow you to install only on one device at once. Meaning you have to pay three times to use your software on all your computers. Cost effective if you are a large company but not if you are an individual. This is where open source alternatives are incredibly useful. But these are often less well known about and people find time consuming to research them, especially sifting through vast quantities of varying quality applications which often you need to try to find out how good they are. Searching ‘free photo editor’ for example will give you a lot to look at. Here is a list of some of the best open source software alternatives to commercial applications. Also i have listed in some cases proprietary ones that are available for free, think Google sketch up, earth etc.
    [Show full text]
  • Comparison of Node Based and Layer Based Compositing
    Beteckning:________________ Department of Industrial Development, IT and Land Management Comparison of Node Based Versus Layer Based Compositing Henric Hedin June 2010 Bachelor Thesis, 15hp, C Computer Science Creative Computer Graphics Examiner & supervisor: Sharon Lazenby Co-examiner: Ann-Sofie Östberg Comparison of Node Based Versus Layer Based Compositing by Henric Hedin Department of Industrial Development, IT and Land Management University of Gävle S-801 76 Gävle, Sweden Email: [email protected] Abstract In movie post-production, compositing is the art of combining visual elements into one seamless shot. There are two classes of programs used to accomplish this: those that are node based and those that are layer based. This research report tries to determine whether there is a great difference between the workflow from two types of compositing software, and if the same result can be achieved by both types of programs. Therefore, it would be especially interesting to small businesses, schools or private users, since most node based programs are usually too expensive to purchase. To perform this experiment, a short film clip requiring a moderate amount of post-production is composited in two different programs; one node based and one layer based, in order that the differences can be studied. The final results are that there is little difference in the visual quality of the end result between the two programs, and that the higher cost of a node based program may not necessarily be worth it for smaller businesses and single users. Keywords: post-production, compositing, layer based, node based, Adobe After Effects, The Foundry Nuke Table of Contents 1 Introduction .............................................................................................................
    [Show full text]
  • Higher Education. Education Success Story
    The University of Portsmouth Higher education. Education Success Story Autodesk® 3ds Max® British University integrates Autodesk® Maya® Autodesk® MotionBuilder™ Autodesk 3ds Max and Autodesk Maya Autodesk® Combustion® into curriculum. When it came to choosing the solutions we would be using in the classrooms and teaching our students, we looked specifically at what the industry was using. We chose 3ds Max and Maya based on their extensive use in the games, film, and TV production industries. —Alex Counsell Principal Technician Faculty of Creative and Cultural Industries University of Portsmouth Image courtesy of the University of Portsmouth. Gateway to Learning Training on Industry-Leading Tools Located on the southern coast of England with “When it came to choosing the solutions we would easy access to London, France, and Spain, the city be using in the classrooms and teaching our students, of Portsmouth is considered a gateway to Europe. we looked specifically at what the industry was using,” This busy, multicultural port is the perfect place for says Alex Counsell, principal technician, Faculty of students from around the world to share ideas, learn Creative and Cultural Industries. “We chose 3ds Max new skills, and develop expertise with and Maya based on their extensive use in the games, leading-edge tools. film, and TV production industries.” The University of Portsmouth has recently formed The university uses 3ds Max and Maya across a wide a Faculty of Creative and Cultural Industries, an range of courses and programs, including computer amalgamation of the creative technologies and animation and computer games technology. It is also the art, design, and media departments, which is incorporating Autodesk® MotionBuilder™ software offering a full range of foundation, undergraduate, into its optical motion-capture pipeline.
    [Show full text]