3D数学基础:图形与游戏开发(英文原版)
《3D数学基础:图形与游戏开发》一书的英文原版电子档,高清,绝对不是扫描版,配有详细的书签,可用来与中文版互查使用,最后配上中文版的目录以供大家参考下载第1章 简介1.1 什么是3D数学1.2 为什么选择本书1.3 阅读本书需要的基础知识1.4 概览第2章 笛卡尔坐标系统2.1 1D数学2.2 2D笛卡尔数学2.3 从2D到3D2.4 练习第3章 多坐标系3.1 为什么要使用多坐标系3.2 一些有用的坐标系3.3 嵌套式坐标系3.4 描述坐标系3.5 坐标系转换3.6 练习第4章 向量4.1 向量——数学定义4.2 向量——几何定义4.3 向量与点4Library of Congress Cataloging-in-Publication DataDunn Fletcher3D math primer for graphics and game development /by Fletcher Dunn and lan ArberrySBN155622-911-91. Computer graphics. 2. Computer games--Programming. 3. Computer science-MathematicsL. Arberry, lan. l. TitleT385.D8752002006.6--dc22002004615CIPC 2002, Wordware Publishing, IncAll Rights reserved2320 Los Rios boulevardPlano. Texas 75074No part of this book may be reproduced in any form or byany means without permission in writing fromWordware Publishing IncPrinted in the United states of americaISBN1-55622-911-910987654320205Product names mentioned are used for identification purposes only and may be trademarks of their respective companiesAll inquiries for volume purchases of this book should be addressed to Wordware Publishing, Inc, at the aboveaddress. Telephone inquiries may be made by calling(972)423-0090ContentsAcknowledgmentsChapter 1 Introduction1. 1 What is 3D Math?1.2 Why You Should Read This book1. 3 What You Should Know Before Reading This book1. 4 OverviewChapter 2 The Cartesian Coordinate System52.1 ID Mathematics2.2 2D Cartesian Mathematics2. 2. 1 An Example: The Hypothetical City of Cartesia2.2.2 Arbitrary 2D Coordinate Spaces2.2. 3 Specifying Locations in 2D USing Cartesian Coordinates2. 3 From 2d to 3D.142. 3. 1 Extra Dimension Extra axis152.3.2 Specifying Locations in 3D2.3.3 Left-handed vs. Right-handed Coordinate Spaces162.3. 4 Some Important Conventions Used in This book2.4 ExercisesChapter 3 Multiple Coordinate Spaces233. 1 Why Multiple coordinate Spaces?243.2 Some Useful Coordinate Spaces3.2. 1 World Space3.2.2 Object Space.263.2.3 Camera space273.2. 4 Inertial Space283.3 Nested Coordinate spaces.303. 4 Specifying coordinate spaces313.5 Coordinate Space Transformations313.6 Exercises34Chapter 4 Vectors。。。。。。,。。。,。,。,。。。,。,。,354.1 Vector-A Mathematical Definition364.1.1 Vectors vs Scalars364.1.2 Vector dimension4.1.3 Notation364.2 Vector-A Geometric DefinitionContents4.2.1 What Does a Vector Look Like374.2.2 Position vS. Displacement384.2.3 Specifying Vectors384.2.4 Vectors as a Sequence of Displacements394.3 Vectors vs. Points404.3.1 Relative Position414.3.2 The Relationship between Points and Vectors4144 Exercises42Chapter 5 Operations on Vectors。455.1 Linear Algebra vs. What We need465.2 Typeface Conventions465.3 The zeroⅤecto475.4 Negating a Vector485.4.1 Official Linear Algebra rule485.4.2 Geometric Interpretation485.5 Vector Magnitude ( Length)495.5. 1 Official Linear Algebra rules495.5.2 Geometric Interpretation505.6 Vector Multiplication by a Scalar6. 1 Official Linear Algebra Rules515.6.2 Geometric Interpretation525. 7 Normalized Vectors535.7.1 Official Linear Algebra rules535.7.2 Geometric Inter535.8 Vector Addition and Subtraction548.1 Official Linear Algebra rul545.8.2 Geometric Interpretation555.8.3 Vector from One point to another575.9 The distance formula575.10 Vector Dot Product585.10. 1 Official Linear Algebra rules585.10.2 Geometric Interpretation5.10.3 Projecting One Vector onto Another..615. 11 Vector Cross Product625.11. 1 Official Linear Algebra Rules625.11.2 Geometric Interpretation......625. 12 Linear Algebra Identities655.13 Exercises67Chapter 6 A Simple 3D Vector Class。696. 1 Class Interface696.2 Class Vector 3 Definition706.3 Design Decisions7363 1 Floats vs. doubles736.3.2 Operator Overloading736.3.3 Provide only the Most Important Operations.746. 3. 4 Don t Overload Too Many operators746.3. 5 Use Const Member functions6.3.6 Use Const arguments756.3.7 Member vs Nonmember Functions63 8 No Default initialization6.3.9 Dont Use Virtual functions6.3.10 Dont Use Information Hiding.7763 11 Global zero vector Constant7863.12No“ point3” Class.6.3. 13 A Word on OptimizationChapter 7 Introduction to Matrices................837. 1 Matrix-A Mathematical Definition837.1.1 Matrix Dimensions and notation7.1.2 Square matrices847.1.3 Vectors as matrices857.1. 4 Transposition7. 1.5 Multiplying a Matrix with a Scalar.867.1.6 Multiplying Two Matrices867.1.7 Multiplying a Vector and a matrix7. 1. 8 Row vS Column Vectors907.2 Matrix-A Geometric Interpretation917. 2. 1 How Does a matrix Transform Vectors?7. 2.2 What Does a matrix Look Like?937.2.3 Summary977.3 ExercisesChapter 8 Matrices and Linear Transformations1018. 1 Transforming an Object vs. Transforming the coordinate space1028.2 Rotation1058.2.1 Rotation in 2D1058.2.2 3D Rotation about Cardinal Axes1068.2. 3 3D Rotation about an arbitrary axis1098.3 Scale8.3. 1 Scaling along Cardinal Axes1121128.3.2 Scale in an Arbitrary Direction8.4 Orthographic Projection8.4.1 Projecting onto a Cardinal axis or plane8.4.2 Projecting onto an Arbitrary Line or Plane1178.5 Reflection1178.6 Shearing1188.7 Combining transformatio8. 8 Classes of transformations1208.8.1 Linear transformations1218.8.2 Affine Transformations122Contents8.8.3 Invertible Transformations1228.8.4 Angle-preserving Transformations.1228.8.5 Orthogonal Transformations1228.8.6 Rigid Body transformations1238.8. 7 Summary of Types of Transformations1238.9 Exercises124Chapter 9 More on Matrices...................1259. 1 Determinant of a matrix1259. 1. I Official Linear Algebra rules1259.1.2 Geometric Interpretation1299.2 Inverse of a matrix1309.2. 1 Official Linear Algebra rules1309.2.2 Geometric Interpretation1329. 3 Orthogonal matrices1329.3. 1 Official Linear Algebra rules1329.3.2 Geometric Interpretation1339.3.3 Orthogonalizing a matrix1349.4 4x4 Homogenous Matrices1359.4.1 4D Homogenous Space1369.4.2 4x4 Translation Matrices1379.4.3 General Affine Transformations1409.4.4 Perspective Projection1419.4.5 A Pinhole Camera1429.4.6 Perspective Projection Using 4x4 Matrices1459.5 Exercises146Chapter 10 Orientation and Angular Displacement in 3D.... 14710. 1 What is Orientation?14810.2 Matrix form14910.2.1 Which matrix?15010.2.2 Advantages of Matrix Form15010.2.3 Disadvantages of Matrix Form15110.2.4 Summary15210.3 Euler Angles15310.3. I What are Euler Angles?15310.3.2 Other Euler Angle Conventions15510.3.3 Advantages of Euler Angles15610.3.4 Disadvantages of Euler Angles15610.3.5 Summary.15910.4 Quaternions.15910.4.1 Quaternion Notation16010.4.2 Quaternions as Complex Numbers.16010.4.3 Quaternions as an Axis-Angle Pair16210.4.4 Quaternion Negation16310.4.5 Identity Quaternion(s)16310.4.6 Quaternion Magnitude16310.4.7 Quaternion Conjugate and Inverse16410.4.8 Quaternion Multiplication(Cross Product)16510.4.9 Quaternion"Difference16810.4.10 Quaternion Dot Product16910.4.11 Quaternion Log, Exp, and Multiplication by a Scalar16910.4. 12 Quaternion Exponentiation17110.4.13 Quaternion Interpolation -aka"Slerp17310.4. 14 Quaternion Splines-aka"Squad.17710.4.15 Advantages/Disadvantages of Quaternions17810.5 Comparison of Methods17910.6 Converting between Representations18010.6.1 Converting euler Angles to a matrix18010.6.2 Converting a Matrix to Euler Angles18210.6.3 Converting a Quaternion to a matrix18510.6.4 Converting a matrix to a quaternion18710.6. 5 Converting Euler Angles to a Quaternion19010.6. 6 Converting a Quaternion to Euler Angles19110.7 Exercises193Chapter 11 Transformations in C++19511.1 Overview19611.2 Class eulerAngles19811.3 Class Quaternion20511. 4 Class rotation matrix21511.5 Class matrix4×3220Chapter 12 Geometric Primitives.................23912.1 Representation Techniques23912.1. 1 Implicit Form23912.1.2 Parametric Form24012. 1. 3"Straightforward"Forms24012. 1. 4 Degrees of Freedom24112.2 Lines and rays24112.2.1 Two Points Representation24212.2.2 Parametric Representation of rays24212.2. 3 Special 2D Representations of lines24312.2. 4 Converting between Representations24512.3 Spheres and circles24612.4 Bounding Boxes24712.4.1 Representing AABBs24812.4.2 Computing AABBs24912.4.3 AABBS VS Bounding Spheres25012.4.4 Transforming aabbs25112.5 Planes25212.5. 1 Implicit Definition- The Plane equation252Contents12.5.2 Definition USing Three Points25312.5. 3"Best-fit?" Plane for More Than Three Points.25412.5. 4 Distance from point to plane25612.6 Triangles25712. 6.1 Basic prof a triangle25712.6.2 Area of a Triangle25812.6.3 Barycentric Space2602.6.4 Special Points26712. 7 Polygons26912.7.1 Simple vs Complex Polygons26912.7.2 Self-intersecting Polygons27012.7.3 Convex vS Concave Polygons27112.7.4 Triangulation and Fanning27412. 8 Exercises275Chapter 13 Geometric Tests27713.1 Closest Point on 2D Implicit Line27713.2 Closest Point on Parametric Ray27813. 3 Closest Point on plane27913. 4 Closest Point on Circle/Sphere28013.5 Closest point in aaBB28013.6 Intersection Tests28113.8 Intersection of Two Rays in d es in 2D13. 7 Intersection of Two Implicit Lines in 2D28228313.9 Intersection of Ray and Plane28413. 10 Intersection of Aabb and plane.28513. 11 Intersection of Three planes28613. 12 Intersection of ray and circle/Sphere28613 13 Intersection of Two Circles/Spheres28813 14 Intersection of Sphere and aabB29113 15 Intersection of Sphere and plane29113 16 Intersection of Ray and Triangle29313. 1 7 Intersection of ray and aabB29713 18 Intersection of Two aabbs29713 19 Other Tests29913.20 Class AabB330013.21 Exercises.316Chapter 14 Triangle Meshes.............。。。31914.1 Representing Meshes32014. 1. 1 Indexed Triangle Mesh.....32014.1.2 Advanced Techniques32214.1.3 Specialized representations for Rendering32214.1.4 Vertex Caching32314.1.5 Triangle Strips32314. 1.6 Triangle fans32714.2 Additional mesh Information32814.2.1 Texture Mapping Coordinates32814.2.2 Surface normals32814.2.3 Lighting Values33014.3 Topology and cons33014.4 Triangle Mesh Operations33114.4.1 Piecewise Operations33114.4.2 Welding Vertices.33114.4.3 Detaching faces.33414.4.4 Edge collapse335144.5 Mesh decimation33514.5 A C++ Triangle mesh Class336Chapter 15 3D Math for Graphics................. 34515.1 Graphics Pipeline overview34615.2 Setting the view parameters34915. 2. 1 Specifying the Output Window34915.2.2 Pixel Aspect Ratio35015.2. 3 The View frustum35115.2. 4 Field of view and Zoom.35115.3 Coordinate spaces35415.3. 1 Modeling and World Space35415.3.2 Camera Space3545.3.3 Clip spa35515.3. 4 Screen Space35715.4 Lighting and Fog35815.4.1 Math on Colors35915.4.2 Light Sources36015.4.3 The Standard Lighting Equation-Overview36115.4.4 The Specular Component36215.4. 5 The Diffuse Component36515.4.6 The ambient Component36615.4.7 Light attenuation36615.4. 8 The Lighting Equation--Putting It All Together36715.4.9Fog36815.4.10 Flat Shading and Gouraud Shading37015.5 Buffers37215.6 Texture Mapping15.7 Geometry Generation/Delivery15.7.1 LOD Selection and Procedural Modeling37515.7. 2 Delivery of geometry to the API37515.8 Transformation and Lighting15.8. 1 Transformation to Clip space37815.8.2 Vertex Lighting37815.9 Backface Culling and Clipping380