Homogenous Coordinates and Projective Geometry (Crudely Speaking) Revision 1.2 Copyright Zachary Wartell, University of North Carolina All Rights Reserved Textbook: Chapter 5-2 ©Zachary Wartell 4/8/2015 Review • points, vectors, alignments: ITCS 4120-2D Coordinates.ppt Slide #13 • vector – all arrows of same length and direction are associated with same vector, v, designated by coordinate (x,y,z) or column matrix [x,y,z,0]T • alignment – For any line, l , there exists an infinite set, S, of all lines parallel to l . Let’s give a coordinate (i.e. a name) to, S, using the slopes of l . Ideas? – l : p0 + t (p1- p0) or p0 + t v then for any other line m in S m : pm0 + t v – Note that set of points {p | p = p0 + t v } = {p | p = p0 + t (k v) } where k R and k ≠ 0 – So we could name the alignment, S, by k v Example: l : ((5,5,5),(10,11,10)) and m : ((5,5,15),(10,11,20)) have alignment (5,6,5), but any coordinate k · (5,6,5) names the same alignment, so many coordinates are valid, e.g. (1,6/5,1), (10,12,10)…. So: “all lines of same slopes are associated with same alignment, i, designated by a one of a set of coordinates k · (x,y,z)” ©Zachary Wartell 4/8/2015 What’s the point ()? • • Affine Geometry: – points and vectors – affine transform: preserve collinearity, parallelism, distance ratios; points points, vectors vectors. – valid matrix valid coordinates (as column matrices) point vector a e i 0 b f j 0 c d g h , k l 0 1 x y z 1 or x y z 0 Projective Geometry – points and alignments (also called ‘points at infinity’ or ‘ideal points’) – projective transform: preserve collinearity, (not parallelism, not distance ratios); points points or alignments, alignments alignments or points – valid matrix valid coordinates point alignment a e i m b f j n c g k o d h , l p x x y y , w 0 or z z w 0 BUT x,y,z not all 0 ©Zachary Wartell 4/8/2015 x y ,k 0 k z { w , 0} name the same point or alignment! Why points (x,y,z,w), w≠0? • From a purely algebraic standpoint, observe: x a y e z i w m d f g h j k l n o p where in general w 1 b c x y z 1 (and sometimes w 0!) • But what does the point’s homogenous coordinate (40,30,50,10) mean? – since any element, P, in the infinite set of coordinates: {P=(x,y,z,w) | k·(40,30,50,10) , k≠0} is defined to represent the same point we can convert (40,30,50,10) to a canonical standard form (x',y',z',1) = 1/w · (x,y,z,w). So: (40,30,50,10) (4,3,5,1) ©Zachary Wartell 4/8/2015 Why is (x,y,z,0), x,y,z≠0 called ‘point at infinity’ or an ‘alignment’? What happens to a line through that point as w0? What happens to a point as w0? (assume z=0; (x,y,w)) (,)(1,1,w0) (,)(1,1,w0) p (1000,1000) (1,1,1/1000) (1000,1000)(1,1,1/1000) (4,4)(1,1,1/4) l4 (4,4)(1,1,1/4) l1 p4 l1000 l2 (2,2)(1,1,1/2) (2,2)(1,1,1/2) p2 (1,1)(1,1,1) (1,1)(1,1,1) p1 (2,1)(2,1,1) m ©Zachary Wartell 4/8/2015 (1,0)(1,0,1) l m Why call (x,y,z,w), w≠0 a "homogenous" coordinate? • Consider 2D Point: – projective coordinate: (xh,yh,wh) – ‘normalized’ affine coordinate: (x,y)=(xh/wh,yh/wh) • Equation of 2D line: – affine coordinate representation: y=mx + b or mx - y + b = 0 (1) Note, mx and y are degree 1, b is degree 0 – homogeneous coordinate representation: mxh/wh - yh/wh + b = 0 or mxh - yh + b wh= 0 (2) Note, mxh, yh, b wh are all degree 1 • Recall equations like (2) where “the degree of every term is the same” are called homogenous equations. Since using 2D point coordinates like (xh,yh,wh) cause line (and other) equations to become homogenous equations, (xh,yh,wh) are called homogenous coordinates ©Zachary Wartell 4/8/2015 What’s the use of Projective Geometry? • In general, projective geometry allows a more extended set of algebraic formula for computing fundamental geometric operations, such as the intersection of two lines, in a manner that always yields a closed form solution. • Example: Compute intersection of lines l and m l : p=(0,0,0) + t (1,1,1) m : p=(1,0,0) + t (1,1,1) With affine geometry’s algebra this yields a ‘/0’ and hence result is algebraically undefined! With projective geometry algebra (not covered in class!), the algebra will yield the ‘ideal point’ (1,1,1,0) This indicates that while these two lines have no ‘regular’ point in common they have in common the same alignment, whose coordinate is (1,1,1,0) ©Zachary Wartell 4/8/2015 Questions? • Isn’t it inconsistent to claim that sometimes we consider (x,y,z,1) and (x,y,z,0) valid column matrix encoded coordinates (affine geometry) and sometimes we consider (x,y,z,w),w≠0 and (x,y,z,0), x,y,z ≠ 0 valid coordinates? – Answer: Yes, it is inconsistent. Essentially, when working computer graphics problems, you must consider which scheme of geometry your using , but ©Zachary Wartell • 99% of the time in Intro. Graphics you just use the affine scheme • and while the projective scheme is necessary for 3D viewing, it occurs in a very well-defined and limited step in the graphics pipeline 4/8/2015 Revisions • 1.1 - spelling ©Zachary Wartell 4/8/2015