Mathematics for and Computer Graphics

 Mathematics for 3D Game Programming and Computer Graphics

Third Edition

Eric Lengyel

Course Technology PTR

A part of Cengage Learning

Australia ? Brazil ? Japan ? Korea ? Mexico ? Singapore ? Spain ? United Kingdom ? United States

Mathematics for 3D Game Programming and Computer Graphics, Third Edition By Eric Lengyel

Publisher and General Manager, Course Technology PTR: Stacy L. Hiquet

Associate Director of Marketing: Sarah Panella

Manager of Editorial Services: Heather Talbot

Marketing Manager: Jordan Castellani

Senior Acquisitions Editor: Emi Smith

Cover Designer: Mike Tanamachi

Proofreader: Mike Beady

? 2012 Course Technology, a part of Cengage Learning.

ALL RIGHTS RESERVED. No part of this work covered by the copyright herein may be reproduced, transmitted, stored, or used in any form or by any means graphic, electronic, or mechanical, including but not limited to photocopying, recording, scanning, digitizing, taping, Web distribution, information networks, or information storage and retrieval systems, except as permitted under Section 107 or 108 of the 1976 United States Copyright Act, without the prior written permission of the publisher.

For product information and technology assistance, contact us at Cengage Learning Customer & Sales Support, 1-800-354-9706 For permission to use material from this text or product, submit all requests online at permissions Further permissions questions can be emailed to permissionrequest@

All trademarks are the property of their respective owners. All images ? Cengage Learning unless otherwise noted. Library of Congress Control Number: 2011924487 ISBN-13: 978-1-4354-5886-4 ISBN-10: 1-4354-5886-9 eISBN-10: 1-4354-5887-7

Course Technology, a part of Cengage Learning 20 Channel Center Street Boston, MA 02210 USA

Cengage Learning is a leading provider of customized learning solutions with office locations around the globe, including Singapore, the United Kingdom, Australia, Mexico, Brazil, and Japan. Locate your local office at: international.region

Cengage Learning products are represented in Canada by Nelson Education, Ltd.

For your lifelong learning solutions, visit Visit our corporate website at

Printed in China 1 2 3 4 5 6 7 13 12 11

Contents

Preface What's New in the Third Edition Contents Overview Website and Code Listings Notational Conventions

Chapter 1 The Rendering Pipeline 1.1 Graphics Processors 1.2 Vertex Transformation 1.3 Rasterization and Fragment Operations

Chapter 2 Vectors 2.1 Vector Properties 2.2 The Dot Product 2.3 The Cross Product 2.4 Vector Spaces Chapter 2 Summary Exercises for Chapter 2

Chapter 3 Matrices 3.1 Matrix Properties 3.2 Linear Systems 3.3 Matrix Inverses 3.4 Determinants 3.5 Eigenvalues and Eigenvectors 3.6 Diagonalization

xiii xiii xiv xvii xvii

1 1 4 6

11 11 15 19 26 29 30

31 31 34 40 47 54 58

iii

iv

Chapter 3 Summary Exercises for Chapter 3

Chapter 4 Transforms

4.1 Linear Transformations 4.1.1 Orthogonal Matrices 4.1.2 Handedness

4.2 Scaling Transforms 4.3 Rotation Transforms

4.3.1 Rotation About an Arbitrary Axis 4.4 Homogeneous Coordinates

4.4.1 Four-Dimensional Transforms 4.4.2 Points and Directions 4.4.3 Geometrical Interpretation of the w Coordinate 4.5 Transforming Normal Vectors 4.6 Quaternions 4.6.1 Quaternion Mathematics 4.6.2 Rotations with Quaternions 4.6.3 Spherical Linear Interpolation Chapter 4 Summary Exercises for Chapter 4

Chapter 5 Geometry for 3D Engines

5.1 Lines in 3D Space 5.1.1 Distance Between a Point and a Line 5.1.2 Distance Between Two Lines

5.2 Planes in 3D Space 5.2.1 Intersection of a Line and a Plane 5.2.2 Intersection of Three Planes 5.2.3 Transforming Planes

5.3 The View Frustum 5.3.1 Field of View 5.3.2 Frustum Planes

5.4 Perspective-Correct Interpolation 5.4.1 Depth Interpolation 5.4.2 Vertex Attribute Interpolation

5.5 Projections 5.5.1 Perspective Projections 5.5.2 Orthographic Projections

Contents

62 64

67

67 68 70 70 71 74 75 76 77 78 78 80 80 82 86 89 91

93

93 93 94 97 98 99 101 102 103 106 107 108 110 111 112 116

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download