As a One Big

As a One Big

Glimpses of geometry and graphics Przemys law Koprowski Contents Introduction 5 Part 1. Geometry of space 7 Chapter 1. Homogeneous coordinates and affine transforms 9 1. Projective space 9 2. Homogeneous coordinates 11 3. Vectors and normals 17 4. Isometries 19 5. Transformation decomposition 23 Implementation notes 25 Exercises 25 Bibliographic notes 25 Chapter 2. Projective space and quaternions 27 1. Projective maps 27 2. Projections and perspective 32 3. Duality and the Pl¨ucker-Grassmann coordinates 41 4. Quaternions and transform interpolation 54 Exercises 62 Bibliographic notes 63 Part 2. Geometry of curves 65 Chapter 3. Cubic curves 67 1. Introduction 67 2. B´eziersplines 71 3. Interpolation with B´ezier curves 75 4. Catmull-Rom splines 79 5. B-splines 85 6. Other cubic representations 89 7. Change of basis 90 8. Curve splitting 93 Implementation notes 95 Exercises 95 Bibliographic notes 96 Chapter 4. Rational parametric curves 103 1. Why rational splines? 103 2. B´eziercurves 106 3 4 CONTENTS 3. Uniform B-splines 112 4. NURBS 118 5. Tangent and curvature 124 6. On-curve alignment 124 7. Manifolds and geometric continuity 124 8. Arc-length parametrization 124 Exercises 124 Chapter 5. Spherical curves 125 1. Transformation interpolation revisited 125 Chapter 6. Algebraic curves 127 1. Affine algebraic curves 127 2. Resultants 128 3. Projective algebraic curves 133 4. Singular points on algebraic curves 138 5. Parametrization of algebraic curves 141 6. Implicitization of parametric curves 147 7. Intersection points 148 8. Hessian and the inflection points 150 9. Cubic curves 154 Implementation notes 163 Exercises 163 Bibliographic notes 163 Part 3. Geometry of solids and surfaces 165 Chapter 7. Polygons and polyhedra 167 1. Triangles 167 2. Convex polytopes 170 3. Convex polygons 171 Chapter 8. Parametric surfaces 173 Bibliography 175 Introduction \They believe the world is run by geometry. All lines and angles and numbers. That sort of thing [ ... ] can lead to some very unsound ideas." | T. Pratchett Part 1 Geometry of space CHAPTER 1 Homogeneous coordinates and affine transforms \Space is essentially one" | I. Kant \We cannot assert with Kant that the propositions of Euclidean geometry possess any universal truth" | A. D'Abro This chapter introduces the notion of homogeneous coordinates, which is one of the fundamental structures in the domain of geometric modeling. To this end we shall define a projective space, which is an extension of an affine space known from the basic linear algebra. We won't, however, present an in-depth exposition of projective geometry in this chapter and, after introducing a homogeneous coordi- nate system, we will restrict ourselves to the affine case, returning to the projective space in Chapter 2. In computer graphics, one constantly deals with basic geometric transforma- tions of R3 such as a rotation, scaling and translation. The former two transfor- mations are linear maps, but the last one is not linear. It is well known, that every linear transform can be represented with a use of matrix multiplication. Fix T T T 3 the canonical basis "1 = (1; 0; 0) , "2 = (0; 1; 0) and "3 = (0; 0; 1) of R . Let 3 τ End R be a linear endomorphism and aij be the i-th coordinate of τ("i), then we2 have 0 1 0 1 0 1 x a11 a12 a13 x τ @yA = @a21 a22 a23A @yA · . z a31 a32 a33 z Our aim is to develop an equally convenient and uniform1 representation for all affine endomorphisms. In fact we will eventually be able to represent an even wider class of functions known as projective maps. 1. Projective space In this section we introduce the notion of a projective space. Let n N be a fixed dimension (in practice we usually need n = 2 or n = 3). Define a relation2 ∼ on the set Rn+1 (0;:::; 0)T by the condition n _ u v u = cv: ∼ () c 0 2Rnf g 1If all the transforms are represented in the same, standardized, fashion, they can be easily implemented in a hardware (e.g. GPU). Build: January 28, 2021 10 Homogeneous coordinates and affine transforms In other words, two non-zero vectors are related if they are linearly dependent (i.e. they belong to the same line through the origin). It is clear that is an equivalence relation. ∼ Definition 1.1. The set PnR of equivalence classes of (n + 1)-dimensional vectors with respect to the relation is called the n-dimensional projective space. T ∼ The class of a vector (x0; : : : ; xn) is denoted by x0 : ::: : xn . J K Of course, in the above definition one can substitute any arbitrary field (e.g. the rationals, the complex numbers,. ) in place of the reals and define respectively the rational projective space PnQ, the complex projective space PnC and so on. We won't need them, however, till Chapter 6. Consider now the subset Ui of the projective space PnR consisting of all the (projective) points having non-zero i-th coordinate: n Ui := x0 : ::: : xn P R xi = 0 : J K 2 j 6 Defining PnR we have excluded the null vector of Rn+1, consequently every pro- n Sn jective point has at least one non-zero coordinate. It follows that P R = i=0 Ui. n Observe that there is a bijection Ui R defined by the formula $ x x x x T x0 : ::: : xi : ::: : xn ( 0=xi;:::; i−1=xi; i+1=xi;:::; n=xi) : J K 7! It allows us to identify Ui (for every 1 i n) with the affine n-dimensional space n n ≤ ≤ n R . The map Ui R is called a dehomogenization of Ui and its inverse R Ui ! ! is the homogenization of Rn. It is most convenient to use them for either the first or the last coordinate and the choice between these two cases is just a matter of taste. We will stick to the latter convention, where the maps have the forms: T homogenization : (x1; : : : ; xn) x1 : ::: : xn : 1 ; 7! Jx x K T dehomogenization : x0 : ::: : xn 1 : xn ( 0=x1;:::; n−1=xn) : J − K 7! Let us characterize the completion of the affine space Rn in the projective space PnR. n Proposition 1.2. There is a canonical bijection between P R Un and the n 1 n (n 1)-dimensional projective space P − R. − Proof. By the very definition Un = x0 : ::: : xn xn = 0 , hence its n J K j 6 completion P R Un consists of all the projective points of the form x0 : ::: : n J xn 1 : 0 . Of course some xi = 0 due to the way we have constructed the projective space.− DroppingK the last coordinate,6 which is constantly zero anyway, we arrive n 1 at P − R. n 0 The set P R Un is called the set of points at infinity. Observe that P R consists n of a single point by definition. Then, the projective line P1R decomposes into a sum of the affine line R1 and the unique point at infinity. Next, the projective plane P2R consists of the affine plane R2 and the line at infinity. Further, the projective 3-space P3R is just the affine 3-space R3 together with the plane at infinity, and so on. There are simple geometric models for these low-dimensional projective spaces. n The coordinates of a projective point x0 : ::: : xn P R are unique only up to a multiplication by a non-zero factor.J Thus, normalizingK 2 them, we may assume that x2 + + x2 = 1. Consequently, every projective point is represented by a 0 ··· n point of a n-dimensional unit sphere Sn Rn+1. Unfortunately, there are two such points. These antipodal points P and ⊂P of a sphere map to the same point in − Build: January 28, 2021 Homogeneous coordinates and affine transforms 11 P P P Q P Q − P − Q Q Q − − Q − P − Figure 1.1. Circle as a model of the projective line the projective space. Consequently, one constructs the projective space by gluing together antipodal points of the unit sphere. In particular, we may easily check that the real projective line P1R can be identified with a unit circle. Imagine a rubber loop representing a circle. Twist it into an \eight-shape" and fold it so that the two halves overlap, joining the points that were originally opposing each other (see Fig. 1.1). We get a circle again! 2. Homogeneous coordinates We will return to the projective space in the next chapter, but for the time being, let us concentrate on the affine space Rn, which we identify with the subset n T n Un P R. Every point P = (x1; : : : ; xn) R can be assigned its projective co- ⊂ 2 ordinates x1 : ::: : xn : 1 . We call them homogeneous coordinates of P and write J T K [x1; : : : ; xn; 1] . In what follows, we always use square brackets when working with homogeneous coordinates and parentheses when dealing with linear/affine coordi- T nates. The distinction between x0 : ::: : xn and [x0; : : : ; xn] is purely artificial for points, but will become importantJ once weK admit vectors into our discussion. A word of caution: the homogeneous coordinates of a point (x; y)T R2 in the 2 plane are [xw; yw; w]T for any non-zero w R. Hence all: [x; y; 1]T, [2x; 2y; 2]T, [ 10:7x; 10:7y; 10:7]T,. refer to the same2 point. Similarly, the homogeneous co- − − − T 3 T T ordinates of a point (x; y; z) R are [x; y; z; 1] as well as [x=3; y=3; z=3; 1=3] ,.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    176 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us