logo资料库

Real-Time Cameras (Morgan Kaufmann. Mark Haigh-Hutchinson ).pdf

第1页 / 共530页
第2页 / 共530页
第3页 / 共530页
第4页 / 共530页
第5页 / 共530页
第6页 / 共530页
第7页 / 共530页
第8页 / 共530页
资料共530页,剩余部分请下载后查看
Front Cover
Real-Time Cameras: A Guide for Game Designers and Developers
Copyright Page
Contents
Foreword
Preface
Acknowledgements
About the Author
Introduction
PART 1 CORE CONCEPTS
CHAPTER 1 Game overview
Real-Time Applications
Game Systems
Game Update Loop
Input
Think
Move
Messaging
Camera
Post-Camera
Render
General Performance Issues
The Camera System
Controls
Scripting
Summary
CHAPTER 2 Camera fundamentals
Real-World Cameras
Usage and properties
Movie projection
Game Cameras
Basic terminology
Transitions
Camera constraints
Camera Presentation Styles
Orthographic presentation (2D)
Perspective presentation (3D)
Hybrid presentation (2.5D)
Camera Behaviors
Cinematic cameras
First person/point of view
Third person/detached view
Hybrid FP/TP cameras
Predictive versus reactive cameras
View Generation
View frustum
View transform
Projection transform
Player Controls
Summary
CHAPTER 3 Cinematography
Nomenclature
Standard cinematography terminology
Real-time cinematography terminology
Movie Cinematic Cameras
Camera motion
Camera orientation
Dynamically Generated Movies/Replay Cameras
Reproduction cameras/keyframed cameras
Scripted cameras
Dynamically generated
Replay camera effects
Scripting
Editing
Shot selection
Framing/composition
Transitions
Tools
Summary
PART 2 DESIGN PRINCIPLES
CHAPTER 4 Camera design
Interactive 2d Camera Systems
Desirable features
View determination
Cinematic 2D Camera Systems
Interactive 3D Camera Systems
Perspective projection
Parallel projection
Cinematic 3D Camera Systems
2.5D Camera Systems
Display Devices
Aspect ratio
Camera Design Process
Game play and technical requirements
Design process overview
Camera design questions
Production pipeline
Staffing requirements
Camera Design Guidelines
Summary
CHAPTER 5 Camera solutions
Game Genre Camera Solutions
First person shooter/adventure
Character/action adventure
Stealth
3D platform
Role-playing games/massively-multi-player online games
Scrolling
Sports
Racing games
Ground (or surface) vehicles
Real-time strategy
Flight simulation
Adventure
Puzzle/party games/board games
Fighting/close combat
Multi-Player Camera Solutions
Single-screen techniques
Split-screen techniques
Transitioning from full-screen to split-screen
Transitioning from split-screen to full-screen
Summary
CHAPTER 6 Camera scripting
What is Meant by Scripting?
Types of Scripting
Scripting languages
Event messaging
Hybrid scripting solutions
Script Objects
Object relationships
Scriptable game hints
Camera Scripting
Camera scripting methods
Camera control
Rules of thumb
Scripting Tools
World editor support
Communication between target platform and development PC
Message/event logging
Object properties debugging
Replay
Console window
Script Debugging
Summary
PART 3 CAMERA ENGINEERING
CHAPTER 7 Position and orientation
Coordinate Schemes
World space
Camera (or eye) space
Screen space
Local (or character) space
Object relative
Desired Position
First person camera positioning
Third person camera positioning
Desired Position Determination Methods
Stationary
Slaved/tracking
Path
Surface constrained
Volume constrained
Framing
Object-framing relative
Axis rotational/spindle
Common Position Problems
Orientation
Orientation representations
Desired Orientation Determination
Constant orientation
Tracking a target object or position
Look-at offset
Locked look-at position
Target object position prediction
Object framing
Idle wandering
Automated orientation control
Reorientation Methods
Applying rotations
Reorientation lag
Offsets
Smoothing and damping
Springs and PID controllers
Look-at position interpolation
Free-Look
First person free-look
Third person free-look
Player motion
Free-look orientation determination
Common orientation problems
Summary
CHAPTER 8 Navigation and occlusion
The Camera as an AI Game Object
Navigation Techniques
Dynamic navigation techniques
Pre-defined navigation techniques
Occlusion
What is considered occlusion?
Why and when does occlusion matter?
Occlusion determination
Occlusion prediction methodologies
Predicting the look-at position
Line of Sight
Resolving line of sight problems
Path generation
Avoiding loss of LOS
Fail-safes
Summary
CHAPTER 9 Motion and collision
Camera Movement Sequence
Character motion
Movement methods
Smoothing and damping techniques
Motion constraints
Player camera control
Camera position control schemes
Manipulation of camera orientation
Automated camera positioning and orientation
Debug camera control
Camera Collisions
The importance of camera collisions
Is collision testing necessary?
Collision determination
Collision geometry design
Collision resolution
Disabling collision detection
Avoiding camera collisions
CHAPTER 10 Camera mathematics
Basic Camera Math
Camera position
Camera orientation
Camera motion
Rendering
General camera math
Camera math problems and fixes
Common Mathematical Techniques
Look-at
Roll removal
Twist reduction
World space to screen space conversion
Screen space to camera/world space conversion
FOV conversion
Quaternions
Bump and Ease Functions
Exponentials
Proportional
Spherical linear interpolation
Transcendentals
Piecewise spline curve
springs
Digital Filters
Low pass
High pass
Band
Finite impulse response
Infinite impulse response
Spline Curves
Camera spline usage
Cubic polynomials
Spline types
Continuity
Spline definitions
Spline evaluation
Control point generation
Parameterized arc length
Total spline length
Closest position
Spline editing
Interpolation
What exactly is interpolation?
Camera Property Interpolation
Position interpolation
Orientation interpolation
FOV interpolation
Viewport Interpolation
Player Control Interpolation
First person cameras
Third person cameras
Interpolation Choices
Linear interpolation
Piecewise interpolation
Methods of Interpolation
Linear time interpolation
Parametric functions
Spherical linear interpolation
Potential Interpolation Problems
Aesthetic problems
Mathematical problems
Interruption of Interpolation
Transitions
Position during transitions
Orientation during transitions
Camera Math Problems
Floating-point precision
Epsilon usage
Compiler differences
Hardware FPU differences
Vector normalization
Matrix concatenation floating-point drift
Periodic Camera Mathematical Fixes
CHAPTER 11 Implementation
Game Engine Architecture
Game update loop
Game system managers
Delta time
Input processing
Camera System Architecture
Viewport manager
Render manager
Camera manager
Camera update loop
Hint manager
Shake manager
Game Cameras
Inherited camera behaviors
Component-based camera behaviors
Cinematic cameras
Debug camera
Scripting System Implementation
Camera script objects
Ordering of scripting logic
Messaging
Prioritization
Interpolation
Performance Considerations
Amortization
Preprocessing
Tools Support
World editor
Camera collision mesh
Camera Debugging Techniques
Interactive debugging
Data logging
Game replaying
Summary
Appendix A: Glossary
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
Y
Z
Appendix B: Extras
References and Bibliography
Index
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
Y
Z
Real-Time Cameras
This page intentionally left blank
Real-Time Cameras: A Guide for Game Designers and Developers Mark Haigh-Hutchinson AMSTERDAM • BOSTON • HEIDELBERG • LONDON • NEW YORK OXFORD • PARIS • SAN DIEGO • SAN FRANCISCO SINGAPORE • SYDNEY • TOKYO Morgan Kaufmann Publishers is an imprint of Elsevier
Morgan Kaufmann Publishers is an imprint of Elsevier. 30 Corporate Drive, Suite 400, Burlington, MA 01803, USA This book is printed on acid-free paper. © 2009 by Elsevier Inc. All rights reserved. Designations used by companies to distinguish their products are often claimed as trademarks or registered trademarks. In all instances in which Morgan Kaufmann Publishers is aware of a claim, the product names appear in initial capital or all capital letters. All trademarks that appear or are otherwise referred to in this work belong to their respective owners. Neither Morgan Kaufmann Publishers nor the authors and other contributors of this work have any relationship or affi liation with such trademark owners nor do such trademark owners confi rm, endorse or approve the contents of this work. Readers, however, should contact the appro- priate companies for more information regarding trademarks and any related registrations. 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, scanning, or otherwise —without prior written permission of the publisher. Permissions may be sought directly from Elsevier’s Science & Technology Rights Department in Oxford, UK: phone: ( ⫹ 44) 1865 843830, fax: ( ⫹ 44) 1865 853333, E-mail: permissions@elsevier.com. You may also complete your request online via the Elsevier homepage ( http://elsevier.com ), by selecting “ Support & Contact ” then “Copyright and Permission ” and then “Obtaining Permissions. ” Library of Congress Cataloging-in-Publication Data ISBN: 978-0-12-311634-5 For information on all Morgan Kaufmann publications, visit our Web site at www.mkp.com or www.elsevierdirect.com Printed in the United States of America 09 10 11 12 13 5 4 3 2 1
Contents Foreword .......................................................................................................................xv Preface ..........................................................................................................................xix Acknowledgements .....................................................................................................xxi About the author .......................................................................................................xxiii Introduction ............................................................................................................... xxv CORE CONCEPTS PART 1 CHAPTER 1 Game overview ............................................................................................ 3 Real-Time Applications ............................................................................ 3 Game Systems ........................................................................................... 3 Game Update Loop .................................................................................. 6 Input ................................................................................................... 8 Think ................................................................................................... 9 Move ..................................................................................................10 Messaging ..........................................................................................10 Camera ...............................................................................................11 Post-Camera ..................................................................................... 12 Render ............................................................................................... 13 General Performance Issues ................................................................... 13 The Camera System ................................................................................ 14 Controls .................................................................................................. 16 Scripting .................................................................................................. 17 Summary ................................................................................................. 19 CHAPTER 2 Camera fundamentals ................................................................................21 Real-World Cameras ................................................................................21 Usage and properties ....................................................................... 24 Movie projection .............................................................................. 25 Game Cameras ........................................................................................ 26 Basic terminology ............................................................................. 28 Transitions ........................................................................................ 39 Camera constraints .......................................................................... 39 Camera Presentation Styles .....................................................................41 Orthographic presentation (2D) ......................................................41 v
vi Contents Perspective presentation (3D) ......................................................... 43 Hybrid presentation (2.5D) ............................................................ 46 Camera Behaviors ................................................................................... 47 Cinematic cameras ........................................................................... 48 First person/point of view ............................................................... 49 Third person/detached view ............................................................ 52 Hybrid FP/TP cameras ......................................................................61 Predictive versus reactive cameras ................................................... 64 View Generation ..................................................................................... 67 View frustum .................................................................................... 68 View transform ................................................................................. 70 Projection transform ........................................................................ 72 Player Controls ....................................................................................... 73 Summary ................................................................................................. 74 CHAPTER 3 Cinematography ........................................................................................ 75 Nomenclature ......................................................................................... 76 Standard cinematography terminology .......................................... 76 Real-time cinematography terminology ......................................... 82 Movie Cinematic Cameras ..................................................................... 86 Camera motion ................................................................................ 86 Camera orientation .......................................................................... 87 Dynamically Generated Movies/Replay Cameras ................................. 87 Reproduction cameras/keyframed cameras .................................... 88 Scripted cameras ............................................................................... 88 Dynamically generated .................................................................... 90 Replay camera effects ....................................................................... 92 Scripting .................................................................................................. 94 Editing ..................................................................................................... 96 Shot selection ................................................................................... 96 Framing/composition ...................................................................... 96 Transitions ........................................................................................ 97 Tools ...................................................................................................... 100 Summary ................................................................................................102 DESIGN PRINCIPLES PART 2 CHAPTER 4 Camera design ..........................................................................................105 Interactive 2d Camera Systems ............................................................ 106 Desirable features ........................................................................... 108
Contents vii View determination ........................................................................ 110 Cinematic 2D Camera Systems .............................................................112 Interactive 3D Camera Systems ............................................................113 Perspective projection .....................................................................114 Parallel projection ...........................................................................114 Cinematic 3D Camera Systems .............................................................117 2.5D Camera Systems ........................................................................... 120 Display Devices ......................................................................................121 Aspect ratio ......................................................................................121 Camera Design Process ........................................................................ 122 Game play and technical requirements ........................................ 123 Design process overview ................................................................ 123 Camera design questions ............................................................... 127 Production pipeline ....................................................................... 130 Staffi ng requirements ......................................................................131 Camera Design Guidelines .................................................................. 132 Summary ............................................................................................... 137 CHAPTER 5 Camera solutions ..................................................................................... 139 Game Genre Camera Solutions ........................................................... 139 First person shooter/adventure ..................................................... 139 Character/action adventure ........................................................... 145 Stealth ............................................................................................. 147 3D platform .................................................................................... 149 Role-playing games/massively-multi-player online games ...........151 Scrolling .......................................................................................... 152 Sports .............................................................................................. 154 Racing games .................................................................................. 159 Ground (or surface) vehicles ......................................................... 161 Real-time strategy ........................................................................... 162 Flight simulation ............................................................................ 162 Adventure ....................................................................................... 165 Puzzle/party games/board games ................................................. 166 Fighting/close combat ................................................................... 168 Multi-Player Camera Solutions ............................................................ 170 Single-screen techniques ................................................................ 172 Split-screen techniques .................................................................. 174 Transitioning from full-screen to split-screen .............................. 176 Transitioning from split-screen to full-screen .............................. 177 Summary ............................................................................................... 177
分享到:
收藏