Opengl game programming
Mark J Kilgard, Kevin Hawkins, Dave Astle, André LaMothe
Résumé
OpenGL Game Programming teaches you how to use OpenGL to create dynamic 3D environments and effects for use in game development. Beginning with the histories of OpenGL and Microsoft DirextX, programming essentials for Microsoft Windows and 3D theory, you'll quickly move on to lessons on the functionality of OpenGL. Most of the chapters include demo programs that will allow you to see OpenGL in action. You'll then learn how to pull together OpenGL, Microsoft DirectSound, and Microsoft DirectInput to create your own games!
What's on the CD:
- Microsoft DirectX 8 software development kit
- OpenGL software development kit
- Over 60 OpenGL demos
- Audio, music, 3D polygon modeling, multimedia scripting, graphics viewer, and more
- Window creation, texture loading, font rendering, and powerful image loading libraries
- Sample games and source code from the book
Table of Contents
p>Letter from the Series Editor
Foreword
Introduction
Part I: Introduction to OpenGl and DirectX
Chapter 1: The Eploration Begins: OpenGl and DirectX
Why Make Games?
The World of 3D Games
The Elements of a Game
Your Tools
What is OpenGL
-
OpenGl History
OpenGL Architecture
The OpenGL Utility Library
What is GLUT
A Sneak Peek
-
DirectX History
DirectX Architecture
-
DirectX Graphics
DirectX Audio
DirectInput
DirectPlay
DirectShow
DirectSetup
Summary
Chapter 2: Using Windows with OpenGL
Introduction to Windows Programming
-
The Basic Windows Application
Getting Started with WinMain()
The Windows procedure
-
Handling Messages
-
Setting the Windows Class Atrributes
Loading Icons and Mouse Pointers
Window Creation
The Message Loop
A Complete Windows Application
-
The Rendering Context
Using WGL
-
wglCreateContext()
wglDeleteContext()
wglMakeCurrent()
-
nSize
dwFlags
iPixelType
cColorBits
Full-Screen OpenGL
Summary
Chapter 3: An Overview of 3D Graphics Theory
Scalars, Points, and Vectors
-
Vector Magnitude
Vector Normalization
Vector Addition
Vector-Scalar Multiplication
The Dot Product
The Cross Product
-
The Identity Matrix
The Zero Matrix
Matrix Addition and Subtraction
Matrix Multiplication
Putting It Together
-
Translation
Rotation
Scaling
-
Parallel Projection
Perspective Projection
Lighting
-
Ambient Light
Diffuse Light
Specular Light
Summary
Part II: Using OpenGL
Chapter 4: OpenGl States and Primitives
State Functions
Handling Primitives
-
Drawing Points in 3D
-
Modifying Point Size
Antialiasing Points
-
Modifying Line Width
Antialiasing Lines Width
Specifying a Stipple Pattern
-
Polygon Face Culling
Hiding Polygon Edges
Antialiasing Polygons
Specifying a Stipple Pattern
Triangles
Quadrilaterals
Polygons
Chapter 5: Coordinate Transformations and OpenGL Matrices
Understanding Coordinate Transfermations
-
The Camera and Eye Coordinates
Viewing Transformations
-
Using the gluLookAt() Function
Using the glRotate*() and glTranslate*O Functions
CreatingYour Own Custom Routines
Projection Transformations
The Viewport Transformation
-
The Modelview Matrix
Translation
Rotation
Scaling
Matrix Stacks
The Robot Example
-
Orthographic
Perspective
Setting the Viewport
Projection Example
-
LoadingYour Matrix
Multiplying Matrices
Custom Matrix Example
Chapter 6: Adding Colors, Blending, and Lighting
How Does ColorWork!
Using Colors in OpenGL
-
Color Depth
The Color Cube
RGBA Mode in OpenGL
Color-lndex Mode in OpenGL
Lighting in OpenGL
-
OpenGL Lighting and the Real World
Materials
Normals
-
Calculating Normals
Using Normals
The Unit Normal
-
Creating Light Sources
Positioning Light Sources
Attenuation
Spotlights
Defining Materials
Lighting Models
Specular Lighting Effects
Moving and Rotating Lights
-
Transparency
Chapter 7: Bitmaps and Images with OpenGL
The OpenGL Bitmap
-
Positioning the Bitmap
Drawing the Bitmap
An OpenGL Bitmap Example
-
Drawing Image Data
Reading from the Screen
Copying Screen Data
Magnification, Reduction, and Flipping
The Windows Bitmap
-
The BMP File Format
Loading BMP Files
Writing BMP Files
-
The Targa File Format
Loading Targa Files
Writing Targa Files
Chapter 8: Texture Mapping
An Overview of Texture Mapping
-
The Checkered-Cube Example
-
2D Textures
I D Textures
3D Textures
-
Generating the Texture Name
Creating and UsingTexture Objects
Texture Functions
Texture Coordinates
-
Repeating and Clamping
-
Automatically Generating Mipmaps
-
The Explanation
The Implementation
-
The Explanation
The Implementation
Chapter 9: Advanced Texture Mapping
Multitexturing
-
Verifying Multitexture Support
Accessing Extension Functions
Establishing the Texture Units
Specifying the Texture Coordinates
-
The Torus in the Sky
Lightmapping
-
Using the Lightmap
Summary
Chapter 10: Display Lists and Vertex Arrays
Display Lists
-
Creating a Display List
Filling a Display List with Commands
Executing Display Lists
Display-List Issues
Destroying Display Lists
Display Lists and Textures
Example: Robot Demo with Display Lists
-
EnablingVertex Arrays
Working with Arrays
-
glDrawArrays()
glDrawElements()
glDrawRangeElements()
glArrayElement()
Locking Arrays
Example:Terrain Demo Revisited
Chapter 11: Displaying Text
Bitmap Fonts
Outline Fonts
Texture-Mapped Fonts
Summary
Chapter 12: OpenGL Buffers
What Is an OpenGL Buffer?
-
Setting Up the Pixel Format
Clearing the Buffers
-
Double-Buffered Systems
Stereo Buffering
-
Depth-Comparison Functions
Using the Depth Buffer
-
A Stencil-Buffer Example
Summary
Chapter 13: OpenGL Quadrics
The Basics of OpenGL Quadrics
-
Draw Style
Normal
Orientation
Texture Coordinates
Cleaning Up
Cylinders
Spheres
Example:A Quadric Fly-Through World
Summary
Chapter 14: Curves and Surfaces
Curve and Surface Representation
-
Parametric Equations
Control Points and Continuity
-
Evenly Spaced Grids
-
Applying Textures to Surfaces
Summary
Chapter 15: Special Effects
Billboarding
-
Example: Cacti in the Desert
-
Parricles
-
Position
Velocity
Life Span
Size
Weight
Representation
Color
Owner
Methods
-
Particle List
Position
Emission Rate
Forces
Default Particle Attributes and Ranges
Current State
Blending
Representation
Methods
Implementation
Particle-System Effects
Example: Snowstorm
-
OpenGL Fog
Volumetric Fog
-
Reflecting Lights
Handling the Depth Buffer
Handling Finite Planes Using Stencil Buffers
Addressing Irregular Reflective Surfaces
Handling Arbitrarily Oriented Planes
-
Static Shadows
Projective Shadows
-
The Shadow-Projection Matrix
Handling Problems with the Depth Buffer
Restricting the Shadow with the Stencil Buffer
Handling Multiple Light Sources and Multiple Planar Surfaces
Problems with Projective Shadows
Other Methods
Example: Reflections and Shadows
Part III: Building a Game
Chapter 16: Using DirectX: DirectInput
Why Use DirectInput?
-
Windows Messages
Win32
-
Win32 Keyboard Input
Win32 Joystick Input
-
Directinput Return Values
-
Adding Devices
-
Creating Devices
Enumerating Devices
Verifying Device Capabilities
Enumerating Objects
Setting the Device Data Format
Setting the Cooperative Level
Modifying Device Properties
Acquiring the Device
-
Immediate Data
Buffered Data
Polling Devices
Building the Input Sub-System
Input Sample Program
Summary
Chapter 17: Using DirectX Audio
The Basics of Sound
-
Sound on the Computer
-
Digitized Sound
Synthesized Sound
-
DirectX Audio Features
-
Loader
Segments and Segment States
Performance
Messages
Performance Channels
DLS Synthesizer
Instruments and Downloading
Audiopaths and Buffers
-
Initialize COM
Create and Initialize the Performance
Create the Loader
Load a Segment
Download the Band
Play the Segment
Stopping a Segment
Is the Segment Playing?
Controlling Segment Loops
Cleaning Up
Using Audiopaths
-
The Default Audiopath
Standard Audiopaths
Playing Sound on Audiopaths
Retrieving Objects from Audiopaths
-
3D Sound Coordinates
Perception
The DirectSound 3D Buffer
Setting 3D Parameters
-
The Minimum and Maximum Distances
Processing Mode
Position and Velocity
Sound Cones
3D ClickingText Example
Chapter 18: Working with 3D Models
3D Model File Formats
The MD2 File Format
-
Our MD2 Implementation
Loading the MD2
Displaying the MD2
Adding the Texture
Animating the Model
Developing a CMD2Model Class
Controlling the Model Animation
Summary
Chapter 19: Physics Modeling with OpenGL
A Physics Review
-
Time
Distance, Displacement, and Position
Velocity
Acceleration
Force
-
Newton's First Law of Motion
Newton's Second Law of Motion
Newton's Third Law of Motion
-
Conservation of Momentum
-
Friction on a Flat Surface
Friction on an Inclined Plane
-
Breaking Things Up
Timing
The Vector
The Plane
The Object
Handling Object Collisions
-
Bounding Spheres
Bounding Boxes
Plane Collisions
Collision Response
-
The Air-Hockey World
The Hockey Table
The Puck and Time-Based Collision
The Player
Putting It Together
Chapter 20: Building a Game Engine
Designing The SimpEngine
-
Managing Data with CNode
Working with Objects: CObjea
-
The Input System
The CEngine Class
The Game Cycle
Handling Input
The SimpEngine
The World
Adding Models
The Audio System
The Particle System
Summary
Chapter 21: Making a Game: A Time to Kill
Initial Design
The Game World
The Enemies
-
Enemy Al
The Ogro
The Sod
The User Interface
Playing the Game
Building the EXE
Summary
Part IV: Appendixes
Appendix A: Online Resources
Game Development
-
GameDev.net
Game Development Search Engine
flipCode
Gamasutra
-
NeHe Productions
OpenGL.org
Additional OpenGL Links
-
DirectX Developer Center
The DirectX Mailing List
-
ParticleSystems.com
Real-Time Rendering
Developer Pages
Fog Articles
Appendix B: Using the CD
The CD User Interface
CD-ROM File Structure
System Requirements
Installation
Miscellaneous Problems and Troubleshooting Information
Still Need Help?
Index
L'auteur - Mark J Kilgard
Mark Kilgard is a member of the Technical Staff at
Silicon Graphics, Inc. He is a contributor to The X Journal
and speaks regularly at the X Technical Conference and
SIGGRAPH. Mark is also the creator of the OpenGL Utility
Toolkit (GLUT).
L'auteur - Dave Astle
Dave Astle is a senior software engineer at QUALCOMM, where he plays a primary role in the development and optimization of their OpenGL ES implementation. He is a founder and operator of GameDev.net, the leading online community for game developers. Astle is coauthor of OpenGL Game Programming and Beginning OpenGL Game Programming, has contributed to numerous other books as an author and editor, and is a regular speaker at game industry conferences.
L'auteur - André LaMothe
holds degrees in mathematics, computer science, and electrical engineering. He is the author of the best-selling books Tricks of the Game Programming Gurus, Teach Yourself Game Programming in 21 Days, and the Black Art of 3D Game Programming. Andre has also written numerous articles in Game Developer, Byte, Software Developer, and Circuit Cellar.
Caractéristiques techniques
PAPIER | |
Éditeur(s) | Prima Publishing |
Auteur(s) | Mark J Kilgard, Kevin Hawkins, Dave Astle, André LaMothe |
Parution | 01/08/2001 |
Nb. de pages | 778 |
Format | 18,8 x 23,1 |
Couverture | Broché |
Poids | 1357g |
Intérieur | Noir et Blanc |
EAN13 | 0086874533301 |
Avantages Eyrolles.com
Consultez aussi
- Les meilleures ventes en Graphisme & Photo
- Les meilleures ventes en Informatique
- Les meilleures ventes en Construction
- Les meilleures ventes en Entreprise & Droit
- Les meilleures ventes en Sciences
- Les meilleures ventes en Littérature
- Les meilleures ventes en Arts & Loisirs
- Les meilleures ventes en Vie pratique
- Les meilleures ventes en Voyage et Tourisme
- Les meilleures ventes en BD et Jeunesse