Coordinate Transformations & Homogeneous Coordinates

Size: px
Start display at page:

Download "Coordinate Transformations & Homogeneous Coordinates"

Transcription

1 CS-C31 (Introduction to) Computer Graphics Jaakko Lehtinen Coordinate Transformations & Homogeneous Coordinates Lots of slides from Frédo Durand CS-C31 Fall 216 Lehtinen

2 Outline Intro to Transformations Useful Classes of Transformations Representing Transformations, Homogeneous Coordinates Combining Transformations Hardcore: Transforming normals CS-C31 Fall 216 Lehtinen 2

3 Modeling/Viewing Pipeline Recap 1.Model the geometry Here a triangle mesh. Also, specify materials. CS-C31 Fall 216 Lehtinen 3

4 Modeling/Viewing Pipeline Recap 1.Model the geometry Here a triangle mesh. Also, specify materials. Object coordinates CS-C31 Fall 216 Lehtinen 4

5 Modeling/Viewing Pipeline Recap 1.Model the geometry 2.Place the objects in world space Each object has its own object space Only one world space Object Object coordinates World coordinates Another Object CS-C31 Fall 216 Lehtinen World Origin 5

6 Modeling/Viewing Pipeline Recap 1.Model the geometry 2.Place the objects in world space 3.Pick viewing position and direction Camera position and orientation Object coordinates World coordinates View coordinates CS-C31 Fall 216 Lehtinen 6

7 Modeling/Viewing Pipeline Recap 1.Model the geometry 2.Place the objects in world space 3.Pick viewing position and direction 4.Transform objects to view space and project to image plane Compute shading CS-C31 Fall 216 Lehtinen Object coordinates World coordinates View coordinates Image coordinates 7

8 Modeling/Viewing Summary Today we ll look at the transformations that take us between these coordinates. Object coordinates World coordinates View coordinates Image coordinates CS-C31 Fall 216 Lehtinen

9 Questions? CS-C31 Fall 216 Lehtinen 9

10 What is a Transformation? A function that maps point x to point x': Applications: animation, deformation, viewing, projection, real-time shadows, From Sederberg and Parry, Siggraph 1986 CS-C31 Fall 216 Lehtinen 1

11 Simple Transformations? CS-C31 Fall 216 Lehtinen 11

12 Simple Transformations Can be combined Are these operations invertible? Yes, except scale = CS-C31 Fall 216 Lehtinen 12

13 Questions? CS-C31 Fall 216 Lehtinen 13

14 Outline Intro to Transformations Useful Classes of Transformations This is the stuff you use for most modeling/viewing Representing Transformations, Homogeneous Coordinates Combining Transformations Transforming Normals CS-C31 Fall 216 Lehtinen 14

15 Rigid-Body / Euclidean Transforms What properties are preserved? Rigid / Euclidean Translation Identity Rotation CS-C31 Fall 216 Lehtinen 15

16 Rigid-Body / Euclidean Transforms Preserves distances Preserves angles Rigid / Euclidean Translation Identity Rotation CS-C31 Fall 216 Lehtinen 16

17 Similitudes / Similarity Transforms Preserves angles The shapes are the same, just at different scale, orientation and location Similitudes Rigid / Euclidean Translation Identity Rotation Isotropic Scaling CS-C31 Fall 216 Lehtinen 17

18 Linear Transformations Similitudes Rigid / Euclidean Linear Translation Identity Rotation Isotropic Scaling Scaling Reflection Shear CS-C31 Fall 216 Lehtinen 18

19 Linear Transformations L(p + q) = L(p) + L(q) L(ap) = a L(p) Similitudes Rigid / Euclidean Linear Translation Identity Rotation Isotropic Scaling Scaling Reflection Shear CS-C31 Fall 216 Lehtinen 19

20 Linear Transformations L(p + q) = L(p) + L(q) L(ap) = a L(p) Similitudes Rigid / Euclidean Linear Translation Identity Rotation Isotropic Scaling Scaling Reflection Shear??? CS-C31 Fall 216 Lehtinen 2

21 Linear Transformations L(p + q) = L(p) + L(q) L(ap) = a L(p)??? Translation Similitudes is not linear: Linear Rigid / Euclidean Scaling Identity f(ap) = ap+t a(p+t) Isotropic Scaling = a f(p) Reflection Rotation Shear Translation f(p) = p+t f(p+q) = p+q+t (p+t)+(q+t) = f(p) + f(q) CS-C31 Fall 216 Lehtinen 21

22 Affine Transformations What is preserved..? Affine Similitudes Rigid / Euclidean Linear Translation Identity Rotation Isotropic Scaling Scaling Reflection Shear CS-C31 Fall 216 Lehtinen 22

23 Affine Transformations Preserves parallel lines Affine Similitudes Rigid / Euclidean Linear Translation Identity Rotation Isotropic Scaling Scaling Reflection Shear CS-C31 Fall 216 Lehtinen 23

24 Projective Transformations Preserves lines: lines remain lines (planes remain planes in 3D) (Planar) Projective Affine Similitudes Rigid / Euclidean Linear Translation Identity Rotation Isotropic Scaling Scaling Reflection Shear Perspective CS-C31 Fall 216 Lehtinen 24

25 What s so nice about these? What s with the hierarchy? Why have we grouped types of transformations with and within each other? (Planar) Projective Affine Similitudes Rigid / Euclidean Identity Translation Rotation Isotropic Scaling Linear Scaling Reflection Shear Perspective CS-C31 Fall 216 Lehtinen 25

26 What s so nice about these? They are closed under concatenation Means e.g. that an affine transformation followed by another affine transformation is still an affine transformation Same for every subgroup, e.g. rotations, translations.. Very convenient! Projections are the most general Others are its special cases Translation (Planar) Projective Rigid / Euclidean Affine Similitudes Identity Rotation Linear Isotropic Scaling Perspective Scaling Reflection CS-C31 Fall 216 Lehtinen 26 Shear

27 Name-dropping Fancy name: Group Theory Remember algebra? A group is a set S with an operation f that takes two elements of S and produces a third: (and some other axioms) s, t S, f(s, t) =u u S These transformations are group(s) and subgroups The transformations are the set S, concatenation of transformations is f CS-C31 Fall 216 Lehtinen 27

28 Transforms are Groups Why is this useful? You can represent any number of successive transformations by a single compound transformation Example The object-to-world transformation, the world-to-view transformation, and the perspective projection (view-to-image) can all be folded into a single projective object-toimage transformation (OpenGL: Modelview, projection) CS-C31 Fall 216 Lehtinen Disclaimer: Not ANY transformation, but the types just introduced Object coordinates World coordinates View coordinates Image coordinates 28

29 Questions? CS-C31 Fall 216 Lehtinen 29

30 More Complex Transformations.....can be built out of these, e.g. Skinning Blending of affine transformations We ll do this later! And you will code it up! :) Ilya Baran CS-C31 Fall 216 Lehtinen 3

31 More Complex Transformations Harmonic coordinates (link to paper) Pixar Object enclosed in simple cage, each object point knows the influence each cage vertex has on it Deform the cage, and the object moves! CS-C31 Fall 216 Lehtinen 31

32 Questions? CS-C31 Fall 216 Lehtinen 32

33 Outline Intro to Transformations Useful Classes of Transformations Representing Transformations, Homogeneous Coordinates Combining Transformations Transforming Normals CS-C31 Fall 216 Lehtinen 33

34 Interlude: ImmersiveMath.com If your matrices and vectors are a little rusty, and even if they aren t, read the first chapters from this really neat interactive linear algebra book! CS-C31 Fall 216 Lehtinen 34

35 How are Linear Transforms Represented? Linear transformations include rotation, scaling, reflection, and shear CS-C31 Fall 216 Lehtinen 35

36 How are Linear Transforms Represented? x' = ax + by y' = dx + ey Linear transformations include rotation, scaling, reflection, and shear CS-C31 Fall 216 Lehtinen 36

37 How are Linear Transforms Represented? x' = ax + by y' = dx + ey Linear transformations include rotation, scaling, reflection, and shear x' y' = a b d e x y p' = M p CS-C31 Fall 216 Lehtinen 37

38 How are Linear Transforms Represented? x' = ax + by y' = dx + ey Linear transformations include rotation, scaling, reflection, and shear Note that the origin always stays fixed. x' y' = a b d e x y p' = M p CS-C31 Fall 216 Lehtinen 38

39 How are Affine Transforms Represented? x' = ax + by + c y' = dx + ey + f Affine transformations include all linear transformations, plus translation x' y' = a b d e x y + c f p' = M p + t CS-C31 Fall 216 Lehtinen 39

40 Can we use matrices for affine transforms? x' = ax + by + c y' = dx + ey + f x' y' = a b d e x y p' = M p? CS-C31 Fall 216 Lehtinen 4

41 The Homogeneous Coordinate Trick This is what we want: x' = ax + by + c y' = dx + ey + f Affine formulation Homogeneous formulation x' y' = a b d e x y + c f x y 1 p' = M p + t CS-C31 Fall 216 Lehtinen 41

42 The Homogeneous Coordinate Trick This is what we want: x' = ax + by + c y' = dx + ey + f Affine formulation Homogeneous formulation x' y' = a b d e x y + c f x' y 1 = a b d e c f 1 x y 1 p' = M p + t p' = M p CS-C31 Fall 216 Lehtinen 42

43 Homogeneous Coordinates Add an extra dimension in 2D, we use 3-vectors and 3 x 3 matrices In 3D, we use 4-vectors and 4 x 4 matrices Makes affine transformations linear in one higher dimension (can be represented by a matrix) Each point has an extra value, w You can think of it as scale For all transformations except perspective, you can just set w=1 and not worry about it x' y 1 = a b d e CS-C31 Fall 216 Lehtinen 43 c f 1 x y 1

44 Homogeneous Coordinates x' y' z' 1 = a e i b f j c g k d h l 1 x y z 1 If we multiply a homogeneous point by an affine matrix, w is unchanged Affine matrix means the last row is ( 1) This form encodes all possible affine transformations! What happens when you multiply an affine matrix with another affine matrix? CS-C31 Fall 216 Lehtinen 44

45 More on w As mentioned, you can think of it as scale. Let s see: x' a b c x = y' d e f y 1 1 1? = a b d e c f 1 2x 2y 2 CS-C31 Fall 216 Lehtinen 45

46 More on w As mentioned, you can think of it as scale. Let s see: x' a b c x = y' d e f y (DUH!) 2x' 2y' 2 = a b d e c f 1 2x 2y 2 CS-C31 Fall 216 Lehtinen 46

47 More on w As mentioned, you can think of it as scale. Let s see: x' a b c x = y' d e f y (DUH!) 2x' 2y' 2 = a b d e c f 1 2x 2y 2 It s tempting to divide by w, because this will get us back to the result above. CS-C31 Fall 216 Lehtinen 47

48 Projective Equivalence in 1D (x,w) w=3 w=2 w w=1 x (,) w= CS-C31 Fall 216 Lehtinen 48

49 Projective Equivalence in 1D We can get into a canonical form by dividing by w. This projects (x, w) onto the line w=1 yielding (x/w, 1). w (x,w) (x/w,1) w=3 w=2 w=1 x (,) w= CS-C31 Fall 216 Lehtinen 49

50 Projective Equivalence in 1D We can get into a canonical form by dividing by w. This projects (x, w) onto the line w=1 yielding (x/w, 1). We say that all points on dashed line are identical because they project to the same point on the line w=1. w (x,w) (x/w,1) w=3 w=2 w=1 x (,) w= CS-C31 Fall 216 Lehtinen 5

51 Projective Equivalence More mathematically, all non-zero scalar multiples of a point are considered identical So, in fact, we are saying that points in ND are identified with lines through the origin in (N+1)D x y z w = ax ay az aw w!= = x/w y/w z/w 1 a!= CS-C31 Fall 216 Lehtinen 51

52 Homogeneous Visualization in 2D Divide by w to normalize (project) (,,) (,, 1) = (,, 2) = (7, 1, 1) = (14, 2, 2) = (4, 5, 1) = (8, 1, 2) = w = 1 w = 2 CS-C31 Fall 216 Lehtinen 52

53 Homogeneous Visualization in 2D Divide by w to normalize (project) w =? Points at infinity (directions) (,,) (,, 1) = (,, 2) = (7, 1, 1) = (14, 2, 2) = (4, 5, 1) = (8, 1, 2) = w = 1 w = 2 CS-C31 Fall 216 Lehtinen 53

54 Projective Equivalence Why? For affine transformations, adding w=1 in the end proved to be convenient. The real showpiece is perspective. CS-C31 Fall 216 Lehtinen 54

55 Projective Equivalence Why? For affine transformations, adding w=1 in the end proved to be convenient. The real showpiece is perspective. From the camera s point of view, all 3D points on the line fall on the same 2D coordinate in the image. In that sense, all those 3D points are identical. CS-C31 Fall 216 Lehtinen 55

56 Questions? CS-C31 Fall 216 Lehtinen 56

57 Translate (tx, ty, tz) y Translate(c,,) Why bother with the extra dimension? Because now translations can be encoded in the matrix! p c p' x x' y' z' 1 = tx ty tz 1 x y z 1 CS-C31 Fall 216 Lehtinen 57

58 What s Actually Happening? x' = x + c x x c CS-C31 Fall 216 Lehtinen 58

59 What s Actually Happening? x' = x + c Let s first add the 2nd dimension w and set coordinates to 1. What does this mean..? (x,1) (x,1) c CS-C31 Fall 216 Lehtinen 59

60 What s Actually Happening? x x x' = x + c w=2 w=1 (x,1) (x,1) w w= x (,) CS-C31 Fall 216 Lehtinen 6

61 What s Actually Happening? x x x' = x + c w=2 w=1 w w= x (,) CS-C31 Fall 216 Lehtinen 61

62 What s Actually Happening? x x x' 1 = 1 c 1 x 1 w=2 w=1 w w= x (,) CS-C31 Fall 216 Lehtinen 62

63 What s Actually Happening? w x x' 1 = 1 c 1 x 1 It s a 2D shear! w=2 w=1 w w= x (,) CS-C31 Fall 216 Lehtinen This line stays put, and origin stays still 63

64 Questions? CS-C31 Fall 216 Lehtinen 64

65 Scale (sx, sy, sz) y Scale(s,s,s) p' Isotropic (uniform) scaling: sx = sy = sz p q q' x x' y' z' 1 = sx sy sz 1 x y z 1 CS-C31 Fall 216 Lehtinen 65

66 Rotation About z axis y ZRotate(θ) θ p' p z x x' y' z' 1 = cos θ sin θ -sin θ cos θ 1 1 x y z 1 CS-C31 Fall 216 Lehtinen 66

67 Rotation y Rotate(k, θ) About (kx, ky, kz), a unit vector on an arbitrary axis (Rodrigues Formula) z θ k x x' y' z' 1 = kxkx(1-c)+c kykx(1-c)+kzs kzkx(1-c)-kys kxky(1-c)-kzs kyky(1-c)+c kzky(1-c)+kxs kxkz(1-c)+kys kykz(1-c)-kxs kzkz(1-c)+c 1 x y z 1 where c = cos θ & s = sin θ CS-C31 Fall 216 Lehtinen 67

68 Rotations and Matrices Rotations are represented by orthonormal matrices, i.e., matrices such that M T M = I This implies det(m) = ±1 (why?) Furthermore, to rule out reflections, require det(m)=1 Rotations are a group of their own Can you prove this based on the above properties? CS-C31 Fall 216 Lehtinen 68

69 Questions? CS-C31 Fall 216 Lehtinen 69

70 A Word of Warning In regular 3D, adding a displacement d to a point p is simple p x + d x p = p + d = p y + d y p z + d z What about homogeneous coordinates? p = p x p y p z 1 + d x d y d z? CS-C31 Fall 216 Lehtinen 7

71 A Word of Warning In regular 3D, adding a displacement d to a point p is simple p x + d x p = p + d = p y + d y p z + d z What about homogeneous coordinates? p = p x p y p z 1 + d x d y d z = p x + d x p y + d y p z + d z 1 CS-C31 Fall 216 Lehtinen You can t add homogeneous points to each other like in 3D. 71

72 A Word of Warning In 3D, px' adding a 1 displacement dx d to px a point p is simple py' 1 p dy x + d py = x pz' p = p + d = 1 p dz y + d pz y p z + d z What about homogeneous coordinates? p = p x p y p z 1 + d x d y d z = p x + d x p y + d y p z + d z 1 CS-C31 Fall 216 Lehtinen w stays the same! You can t add homogeneous points to each other like in 3D. 72

73 The Same for Scaling ap x ap= ap y ap z a Remember projective equivalence CS-C31 Fall 216 Lehtinen 73

74 The Same for Scaling ap x ap= ap y ap z 1 You also leave w fixed. CS-C31 Fall 216 Lehtinen 74

75 Summary Important! Affine n-d transformations are encoded by linear transformations in (n+1)d that move corresponding homogeneous points in the w=1 (hyper)plane Technically, w=any constant works too, just have to scale translation distances as well. CS-C31 Fall 216 Lehtinen 75

76 Questions? CS-C31 Fall 216 Lehtinen 76

77 Why Bother II: Perspective This picture gives away almost the whole story. w = 1 w = 2 CS-C31 Fall 216 Lehtinen 77

78 Perspective in 2D Camera at origin, looking along z, 9 degree f.o.v., image plane at z=1 x=-z p=(x,z) x=z z x p =(x/z,1) (,) z=1 z= CS-C31 Fall 216 Lehtinen 78

79 Perspective in 2D x=-z The projected point in homogeneous coordinates (we just added w=1): x/z p = 1 1 x=z p=(x,z) z x p =(x/z,1) (,) z=1 z= CS-C31 Fall 216 Lehtinen 79

80 Perspective in 2D x=-z x/z p = 1 1 x=z x z z p=(x,z) Projectively equivalent z x p =(x/z,1) (,) z=1 z= CS-C31 Fall 216 Lehtinen 8

81 How do you do this with a matrix? 1 za 1 A 1 za z 1 CS-C31 Fall 216 Lehtinen 81

82 Perspective in 2D We ll just copy z to w, and get the projected point after homogenization! x=-z p x 1 x z = 1 z z 1 1 x=z p=(x,z) z x p =(x/z,1) (,) z=1 z= CS-C31 Fall 216 Lehtinen 82

83 Extension to 3D Trivial: Just add another dimension y and treat it like x z is the special one, it turns into w Different fields of view and non-square image aspect ratios can be accomplished by simple scaling of the x and y axes. x y z w = x y z 1 CS-C31 Fall 216 Lehtinen 83

84 Caveat These projections matrices work perfectly in the sense that you get the proper 2D projections of 3D points. However, since we are flattening the scene onto the z=1 plane, we ve lost all information about the distance to camera. Not a big deal for ray tracers, but GPUs need distances for Z buffering, i.e., figuring out what is in front of what. CS-C31 Fall 216 Lehtinen 84

85 The View Frustum in 2D (In 3D this would be a truncated pyramid.) z=far p q z x (,) z=1 z=near z= CS-C31 Fall 216 Lehtinen 85

86 The View Frustum in 2D We can transform the frustum by a modified projection in a way that makes it a square after projection and homogenization (division by w). z x x z w 1 = f+n f n 1 2 f n f n CS-C31 Fall 216 Lehtinen z /w x /w x z, 1 These z /w values go into the Z buffer. 86

87 Details in Handout in MyCourses Understanding Projections and Homogenous Coordinates How you get the matrix from previous slide Fun demonstration: Print the following page out. Holding the paper as flat as possible, try to see if you can hold it at such an angle in front of you so that the grid looks like a square with a regular grid in it. CS-C31 Fall 216 Lehtinen 87

88 CS-C31 Fall 216 Lehtinen 88

89 Cool Application Video Structure from Motion -algorithms SfM if a branch of computer vision that tries to understand the 3D structure of the scene from pictures taken from different viewpoints. It s all based on projective geometry and homogeneous coordinates. Examples: CS-C31 Fall 216 Lehtinen 89

90 Want to Know More? Take Ville Kyrki s Machine Perception (AS ) to know more! CS-C31 Fall 216 Lehtinen 9

91 CS-C31 Fall 216 Lehtinen 91

92 Phase 3: Profit All these are linear in homogeneous coordinates! Projective Affine Similitudes Rigid / Euclidean Linear Translation Identity Rotation Isotropic Scaling Scaling Reflection Shear Perspective CS-C31 Fall 216 Lehtinen 92

93 Outline Intro to Transformations Useful Classes of Transformations Representing Transformations, Homogeneous Coordinates Combining Transformations Transforming Normals CS-C31 Fall 216 Lehtinen 93

94 How are transforms combined? Scale then Translate (,) (1,1) Scale(2,2) (,) (2,2) Translate(3,1) (3,1) (5,3) Use matrix multiplication: p' = T ( S p ) = TS p TS = = Caution: matrix multiplication is NOT commutative! CS-C31 Fall 216 Lehtinen 94

95 Non-commutative Composition Scale then Translate: p' = T ( S p ) = TS p (,) (1,1) Scale(2,2) (,) (2,2) Translate(3,1) (3,1) (5,3) Translate then Scale: p' = S ( T p ) = ST p (8,4) (,) (1,1) Translate(3,1) (3,1) (4,2) Scale(2,2) (6,2) CS-C31 Fall 216 Lehtinen 95

96 CS-C31 Fall 216 Lehtinen 96 TS = ST = Non-commutative Composition Scale then Translate: p' = T ( S p ) = TS p = = Translate then Scale: p' = S ( T p ) = ST p 1 1 1

97 Questions? CS-C31 Fall 216 Lehtinen 97

98 Outline Intro to Transformations Useful Classes of Transformations Representing Transformations, Homogeneous Coordinates Combining Transformations Transforming Normals CS-C31 Fall 216 Lehtinen 98

99 Normal Surface Normal: unit vector that is locally perpendicular to the surface CS-C31 Fall 216 Lehtinen 99

100 Why is the Normal important? It's used for shading makes things look 3D! object color only Diffuse Shading CS-C31 Fall 216 Lehtinen 1

101 Visualization of Surface Normal ± x = Red ± y = Green ± z = Blue CS-C31 Fall 216 Lehtinen 11

102 How do we transform normals? n WS n OS Object Space World Space CS-C31 Fall 216 Lehtinen 12

103 Transform Normal like Object? translation? rotation? isotropic scale? scale? reflection? shear? perspective? CS-C31 Fall 216 Lehtinen 13

104 Transform Normal like Object? translation? rotation? isotropic scale? scale? reflection? shear? perspective? CS-C31 Fall 216 Lehtinen 14

105 What class of transforms? Projective Affine Similitudes Rigid / Euclidean Linear Translation Identity Rotation Isotropic Scaling Scaling Reflection Shear Perspective a.k.a. Orthogonal Transforms CS-C31 Fall 216 Lehtinen 15

106 Transformation for shear and scale Incorrect Normal Transformation Correct Normal Transformation CS-C31 Fall 216 Lehtinen 16

107 More Normal Visualizations Incorrect Normal Transformation Correct Normal Transformation CS-C31 Fall 216 Lehtinen 17

108 So how do we do it right? Think about transforming the tangent plane to the normal, not the normal vector n OS n WS v OS Original Incorrect Correct v WS Pick any vector v OS in the tangent plane, how is it transformed by matrix M? v WS = M v OS CS-C31 Fall 216 Lehtinen 18

109 Transform tangent vector v v is perpendicular to normal n: Dot product n OS T v OS = n T OS (M -1 M) v OS = (n T OS M -1 ) (M v OS ) = (n T OS M -1 ) v WS = v WS is perpendicular to normal n WS : n WS n WS T = n OS T (M -1 ) n OS v OS v WS n WS = (M -1 ) T n OS n T WS v WS = CS-C31 Fall 216 Lehtinen 19

110 Digression n WS = (M -1 ) T n OS The previous proof is not quite rigorous; first you d need to prove that tangents indeed transform with M. Turns out they do, but we ll take it on faith here. If you believe that, then the above formula follows. CS-C31 Fall 216 Lehtinen 11

111 Comment So the correct way to transform normals is: n WS = (M -1 ) T n OS Sometimes denoted M -T But why did n WS = M n OS work for similitudes? Because for similitude / similarity transforms, (M -1 ) T =λ M e.g. for orthonormal basis: M -1 = M T i.e. (M -1 ) T = M CS-C31 Fall 216 Lehtinen 111

112 Connections Not part of class, but cool Covariant : transformed by the matrix e.g., tangent Contravariant : transformed by the inverse transpose e.g., the normal a normal is a co-vector Google differential geometry to find out more CS-C31 Fall 216 Lehtinen 112

113 Questions? CS-C31 Fall 216 Lehtinen 113

114 That s All for Today Further Reading Projection handout (MyCourses) Other Cool Stuff Algebraic Groups Free-form deformation of solid objects Harmonic coordinates for character articulation CS-C31 Fall 216 Lehtinen 114

Transforms. COMP 575/770 Spring 2013

Transforms. COMP 575/770 Spring 2013 Transforms COMP 575/770 Spring 2013 Transforming Geometry Given any set of points S Could be a 2D shape, a 3D object A transform is a function T that modifies all points in S: T S S T v v S Different transforms

More information

Vector Algebra Transformations. Lecture 4

Vector Algebra Transformations. Lecture 4 Vector Algebra Transformations Lecture 4 Cornell CS4620 Fall 2008 Lecture 4 2008 Steve Marschner 1 Geometry A part of mathematics concerned with questions of size, shape, and relative positions of figures

More information

Overview. By end of the week:

Overview. By end of the week: Overview By end of the week: - Know the basics of git - Make sure we can all compile and run a C++/ OpenGL program - Understand the OpenGL rendering pipeline - Understand how matrices are used for geometric

More information

Last week. Machiraju/Zhang/Möller/Fuhrmann

Last week. Machiraju/Zhang/Möller/Fuhrmann Last week Machiraju/Zhang/Möller/Fuhrmann 1 Geometry basics Scalar, point, and vector Vector space and affine space Basic point and vector operations Sided-ness test Lines, planes, and triangles Linear

More information

Transformations in Ray Tracing. MIT EECS 6.837, Durand and Cutler

Transformations in Ray Tracing. MIT EECS 6.837, Durand and Cutler Transformations in Ray Tracing Linear Algebra Review Session Tonight! 7:30 9 PM Last Time: Simple Transformations Classes of Transformations Representation homogeneous coordinates Composition not commutative

More information

Models and The Viewing Pipeline. Jian Huang CS456

Models and The Viewing Pipeline. Jian Huang CS456 Models and The Viewing Pipeline Jian Huang CS456 Vertex coordinates list, polygon table and (maybe) edge table Auxiliary: Per vertex normal Neighborhood information, arranged with regard to vertices and

More information

2D/3D Geometric Transformations and Scene Graphs

2D/3D Geometric Transformations and Scene Graphs 2D/3D Geometric Transformations and Scene Graphs Week 4 Acknowledgement: The course slides are adapted from the slides prepared by Steve Marschner of Cornell University 1 A little quick math background

More information

Math background. 2D Geometric Transformations. Implicit representations. Explicit representations. Read: CS 4620 Lecture 6

Math background. 2D Geometric Transformations. Implicit representations. Explicit representations. Read: CS 4620 Lecture 6 Math background 2D Geometric Transformations CS 4620 Lecture 6 Read: Chapter 2: Miscellaneous Math Chapter 5: Linear Algebra Notation for sets, functions, mappings Linear transformations Matrices Matrix-vector

More information

3D Mathematics. Co-ordinate systems, 3D primitives and affine transformations

3D Mathematics. Co-ordinate systems, 3D primitives and affine transformations 3D Mathematics Co-ordinate systems, 3D primitives and affine transformations Coordinate Systems 2 3 Primitive Types and Topologies Primitives Primitive Types and Topologies 4 A primitive is the most basic

More information

Today. Today. Introduction. Matrices. Matrices. Computergrafik. Transformations & matrices Introduction Matrices

Today. Today. Introduction. Matrices. Matrices. Computergrafik. Transformations & matrices Introduction Matrices Computergrafik Matthias Zwicker Universität Bern Herbst 2008 Today Transformations & matrices Introduction Matrices Homogeneous Affine transformations Concatenating transformations Change of Common coordinate

More information

UNIT 2 2D TRANSFORMATIONS

UNIT 2 2D TRANSFORMATIONS UNIT 2 2D TRANSFORMATIONS Introduction With the procedures for displaying output primitives and their attributes, we can create variety of pictures and graphs. In many applications, there is also a need

More information

3D Viewing. CS 4620 Lecture 8

3D Viewing. CS 4620 Lecture 8 3D Viewing CS 46 Lecture 8 13 Steve Marschner 1 Viewing, backward and forward So far have used the backward approach to viewing start from pixel ask what part of scene projects to pixel explicitly construct

More information

6.837 Computer Graphics Hierarchical Modeling Wojciech Matusik, MIT EECS Some slides from BarbCutler & Jaakko Lehtinen

6.837 Computer Graphics Hierarchical Modeling Wojciech Matusik, MIT EECS Some slides from BarbCutler & Jaakko Lehtinen 6.837 Computer Graphics Hierarchical Modeling Wojciech Matusik, MIT EECS Some slides from BarbCutler & Jaakko Lehtinen Image courtesy of BrokenSphere on Wikimedia Commons. License: CC-BY-SA. This content

More information

2D transformations: An introduction to the maths behind computer graphics

2D transformations: An introduction to the maths behind computer graphics 2D transformations: An introduction to the maths behind computer graphics Lecturer: Dr Dan Cornford d.cornford@aston.ac.uk http://wiki.aston.ac.uk/dancornford CS2150, Computer Graphics, Aston University,

More information

GEOMETRIC TRANSFORMATIONS AND VIEWING

GEOMETRIC TRANSFORMATIONS AND VIEWING GEOMETRIC TRANSFORMATIONS AND VIEWING 2D and 3D 1/44 2D TRANSFORMATIONS HOMOGENIZED Transformation Scaling Rotation Translation Matrix s x s y cosθ sinθ sinθ cosθ 1 dx 1 dy These 3 transformations are

More information

Interactive Computer Graphics. Hearn & Baker, chapter D transforms Hearn & Baker, chapter 5. Aliasing and Anti-Aliasing

Interactive Computer Graphics. Hearn & Baker, chapter D transforms Hearn & Baker, chapter 5. Aliasing and Anti-Aliasing Interactive Computer Graphics Aliasing and Anti-Aliasing Hearn & Baker, chapter 4-7 D transforms Hearn & Baker, chapter 5 Aliasing and Anti-Aliasing Problem: jaggies Also known as aliasing. It results

More information

Game Architecture. 2/19/16: Rasterization

Game Architecture. 2/19/16: Rasterization Game Architecture 2/19/16: Rasterization Viewing To render a scene, need to know Where am I and What am I looking at The view transform is the matrix that does this Maps a standard view space into world

More information

CSE528 Computer Graphics: Theory, Algorithms, and Applications

CSE528 Computer Graphics: Theory, Algorithms, and Applications CSE528 Computer Graphics: Theory, Algorithms, and Applications Hong Qin Stony Brook University (SUNY at Stony Brook) Stony Brook, New York 11794-2424 Tel: (631)632-845; Fax: (631)632-8334 qin@cs.stonybrook.edu

More information

CSE328 Fundamentals of Computer Graphics

CSE328 Fundamentals of Computer Graphics CSE328 Fundamentals of Computer Graphics Hong Qin State University of New York at Stony Brook (Stony Brook University) Stony Brook, New York 794--44 Tel: (63)632-845; Fax: (63)632-8334 qin@cs.sunysb.edu

More information

Graphics and Interaction Transformation geometry and homogeneous coordinates

Graphics and Interaction Transformation geometry and homogeneous coordinates 433-324 Graphics and Interaction Transformation geometry and homogeneous coordinates Department of Computer Science and Software Engineering The Lecture outline Introduction Vectors and matrices Translation

More information

COMP30019 Graphics and Interaction Transformation geometry and homogeneous coordinates

COMP30019 Graphics and Interaction Transformation geometry and homogeneous coordinates COMP30019 Graphics and Interaction Transformation geometry and homogeneous coordinates Department of Computer Science and Software Engineering The Lecture outline Introduction Vectors and matrices Translation

More information

Geometric transformations assign a point to a point, so it is a point valued function of points. Geometric transformation may destroy the equation

Geometric transformations assign a point to a point, so it is a point valued function of points. Geometric transformation may destroy the equation Geometric transformations assign a point to a point, so it is a point valued function of points. Geometric transformation may destroy the equation and the type of an object. Even simple scaling turns a

More information

2D and 3D Coordinate Systems and Transformations

2D and 3D Coordinate Systems and Transformations Graphics & Visualization Chapter 3 2D and 3D Coordinate Systems and Transformations Graphics & Visualization: Principles & Algorithms Introduction In computer graphics is often necessary to change: the

More information

Lecture 4. Viewing, Projection and Viewport Transformations

Lecture 4. Viewing, Projection and Viewport Transformations Notes on Assignment Notes on Assignment Hw2 is dependent on hw1 so hw1 and hw2 will be graded together i.e. You have time to finish both by next monday 11:59p Email list issues - please cc: elif@cs.nyu.edu

More information

DRAFT: Mathematical Background for Three-Dimensional Computer Graphics. Jonathan R. Senning Gordon College

DRAFT: Mathematical Background for Three-Dimensional Computer Graphics. Jonathan R. Senning Gordon College DRAFT: Mathematical Background for Three-Dimensional Computer Graphics Jonathan R. Senning Gordon College September 2006 ii Contents Introduction 2 Affine Geometry 3 2. Affine Space...................................

More information

Geometric Transformations

Geometric Transformations Geometric Transformations CS 4620 Lecture 9 2017 Steve Marschner 1 A little quick math background Notation for sets, functions, mappings Linear and affine transformations Matrices Matrix-vector multiplication

More information

Notes on Assignment. Notes on Assignment. Notes on Assignment. Notes on Assignment

Notes on Assignment. Notes on Assignment. Notes on Assignment. Notes on Assignment Notes on Assignment Notes on Assignment Objects on screen - made of primitives Primitives are points, lines, polygons - watch vertex ordering The main object you need is a box When the MODELVIEW matrix

More information

Drawing in 3D (viewing, projection, and the rest of the pipeline)

Drawing in 3D (viewing, projection, and the rest of the pipeline) Drawing in 3D (viewing, projection, and the rest of the pipeline) CS559 Spring 2017 Lecture 6 February 2, 2017 The first 4 Key Ideas 1. Work in convenient coordinate systems. Use transformations to get

More information

Computer Graphics. Chapter 5 Geometric Transformations. Somsak Walairacht, Computer Engineering, KMITL

Computer Graphics. Chapter 5 Geometric Transformations. Somsak Walairacht, Computer Engineering, KMITL Chapter 5 Geometric Transformations Somsak Walairacht, Computer Engineering, KMITL 1 Outline Basic Two-Dimensional Geometric Transformations Matrix Representations and Homogeneous Coordinates Inverse Transformations

More information

N-Views (1) Homographies and Projection

N-Views (1) Homographies and Projection CS 4495 Computer Vision N-Views (1) Homographies and Projection Aaron Bobick School of Interactive Computing Administrivia PS 2: Get SDD and Normalized Correlation working for a given windows size say

More information

3D Viewing. CS 4620 Lecture Steve Marschner. Cornell CS4620 Spring 2018 Lecture 9

3D Viewing. CS 4620 Lecture Steve Marschner. Cornell CS4620 Spring 2018 Lecture 9 3D Viewing CS 46 Lecture 9 Cornell CS46 Spring 18 Lecture 9 18 Steve Marschner 1 Viewing, backward and forward So far have used the backward approach to viewing start from pixel ask what part of scene

More information

CSCI-4530/6530 Advanced Computer Graphics

CSCI-4530/6530 Advanced Computer Graphics Luo Jr. CSCI-45/65 Advanced Computer Graphics http://www.cs.rpi.edu/~cutler/classes/advancedgraphics/s9/ Barb Cutler cutler@cs.rpi.edu MRC 9A Piar Animation Studios, 986 Topics for the Semester Mesh Simplification

More information

Viewing and Projection

Viewing and Projection 15-462 Computer Graphics I Lecture 5 Viewing and Projection Shear Transformation Camera Positioning Simple Parallel Projections Simple Perspective Projections [Angel, Ch. 5.2-5.4] January 30, 2003 [Red

More information

Computer Graphics 7: Viewing in 3-D

Computer Graphics 7: Viewing in 3-D Computer Graphics 7: Viewing in 3-D In today s lecture we are going to have a look at: Transformations in 3-D How do transformations in 3-D work? Contents 3-D homogeneous coordinates and matrix based transformations

More information

Basic Elements. Geometry is the study of the relationships among objects in an n-dimensional space

Basic Elements. Geometry is the study of the relationships among objects in an n-dimensional space Basic Elements Geometry is the study of the relationships among objects in an n-dimensional space In computer graphics, we are interested in objects that exist in three dimensions We want a minimum set

More information

CS 130 Final. Fall 2015

CS 130 Final. Fall 2015 CS 130 Final Fall 2015 Name Student ID Signature You may not ask any questions during the test. If you believe that there is something wrong with a question, write down what you think the question is trying

More information

CS230 : Computer Graphics Lecture 6: Viewing Transformations. Tamar Shinar Computer Science & Engineering UC Riverside

CS230 : Computer Graphics Lecture 6: Viewing Transformations. Tamar Shinar Computer Science & Engineering UC Riverside CS230 : Computer Graphics Lecture 6: Viewing Transformations Tamar Shinar Computer Science & Engineering UC Riverside Rendering approaches 1. image-oriented foreach pixel... 2. object-oriented foreach

More information

Projection and viewing. Computer Graphics CSE 167 Lecture 4

Projection and viewing. Computer Graphics CSE 167 Lecture 4 Projection and viewing Computer Graphics CSE 167 Lecture 4 CSE 167: Computer Graphics Review: transformation from the object (or model) coordinate frame to the camera (or eye) coordinate frame Projection

More information

Transformations. Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico

Transformations. Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico Transformations Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico Angel: Interactive Computer Graphics 4E Addison-Wesley 25 1 Objectives

More information

EECE 478. Learning Objectives. Learning Objectives. Linear Algebra and 3D Geometry. Linear algebra in 3D. Coordinate systems

EECE 478. Learning Objectives. Learning Objectives. Linear Algebra and 3D Geometry. Linear algebra in 3D. Coordinate systems EECE 478 Linear Algebra and 3D Geometry Learning Objectives Linear algebra in 3D Define scalars, points, vectors, lines, planes Manipulate to test geometric properties Coordinate systems Use homogeneous

More information

Drawing in 3D (viewing, projection, and the rest of the pipeline)

Drawing in 3D (viewing, projection, and the rest of the pipeline) Drawing in 3D (viewing, projection, and the rest of the pipeline) CS559 Fall 2016 Lecture 6/7 September 26-28 2016 The first 4 Key Ideas 1. Work in convenient coordinate systems. Use transformations to

More information

To Do. Outline. Translation. Homogeneous Coordinates. Foundations of Computer Graphics. Representation of Points (4-Vectors) Start doing HW 1

To Do. Outline. Translation. Homogeneous Coordinates. Foundations of Computer Graphics. Representation of Points (4-Vectors) Start doing HW 1 Foundations of Computer Graphics Homogeneous Coordinates Start doing HW 1 To Do Specifics of HW 1 Last lecture covered basic material on transformations in 2D Likely need this lecture to understand full

More information

Today. Rendering algorithms. Rendering algorithms. Images. Images. Rendering Algorithms. Course overview Organization Introduction to ray tracing

Today. Rendering algorithms. Rendering algorithms. Images. Images. Rendering Algorithms. Course overview Organization Introduction to ray tracing Today Rendering Algorithms Course overview Organization Introduction to ray tracing Spring 2009 Matthias Zwicker Universität Bern Rendering algorithms Problem statement Given computer representation of

More information

Specifying Complex Scenes

Specifying Complex Scenes Transformations Specifying Complex Scenes (x,y,z) (r x,r y,r z ) 2 (,,) Specifying Complex Scenes Absolute position is not very natural Need a way to describe relative relationship: The lego is on top

More information

Today. Rendering pipeline. Rendering pipeline. Object vs. Image order. Rendering engine Rendering engine (jtrt) Computergrafik. Rendering pipeline

Today. Rendering pipeline. Rendering pipeline. Object vs. Image order. Rendering engine Rendering engine (jtrt) Computergrafik. Rendering pipeline Computergrafik Today Rendering pipeline s View volumes, clipping Viewport Matthias Zwicker Universität Bern Herbst 2008 Rendering pipeline Rendering pipeline Hardware & software that draws 3D scenes on

More information

Linear and Affine Transformations Coordinate Systems

Linear and Affine Transformations Coordinate Systems Linear and Affine Transformations Coordinate Systems Recall A transformation T is linear if Recall A transformation T is linear if Every linear transformation can be represented as matrix Linear Transformation

More information

INTRODUCTION TO COMPUTER GRAPHICS. It looks like a matrix Sort of. Viewing III. Projection in Practice. Bin Sheng 10/11/ / 52

INTRODUCTION TO COMPUTER GRAPHICS. It looks like a matrix Sort of. Viewing III. Projection in Practice. Bin Sheng 10/11/ / 52 cs337 It looks like a matrix Sort of Viewing III Projection in Practice / 52 cs337 Arbitrary 3D views Now that we have familiarity with terms we can say that these view volumes/frusta can be specified

More information

CMSC427: Computer Graphics Lecture Notes Last update: November 21, 2014

CMSC427: Computer Graphics Lecture Notes Last update: November 21, 2014 CMSC427: Computer Graphics Lecture Notes Last update: November 21, 2014 TA: Josh Bradley 1 Linear Algebra Review 1.1 Vector Multiplication Suppose we have a vector a = [ x a y a ] T z a. Then for some

More information

CS4620/5620. Professor: Kavita Bala. Cornell CS4620/5620 Fall 2012 Lecture Kavita Bala 1 (with previous instructors James/Marschner)

CS4620/5620. Professor: Kavita Bala. Cornell CS4620/5620 Fall 2012 Lecture Kavita Bala 1 (with previous instructors James/Marschner) CS4620/5620 Affine and 3D Transformations Professor: Kavita Bala 1 Announcements Updated schedule on course web page 2 Prelim days finalized and posted Oct 11, Nov 29 No final exam, final project will

More information

Computer Vision I - Appearance-based Matching and Projective Geometry

Computer Vision I - Appearance-based Matching and Projective Geometry Computer Vision I - Appearance-based Matching and Projective Geometry Carsten Rother 05/11/2015 Computer Vision I: Image Formation Process Roadmap for next four lectures Computer Vision I: Image Formation

More information

CS452/552; EE465/505. Geometry Transformations

CS452/552; EE465/505. Geometry Transformations CS452/552; EE465/505 Geometry Transformations 1-26-15 Outline! Geometry: scalars, points & vectors! Transformations Read: Angel, Chapter 4 (study cube.html/cube.js example) Appendix B: Spaces (vector,

More information

2D Image Transforms Computer Vision (Kris Kitani) Carnegie Mellon University

2D Image Transforms Computer Vision (Kris Kitani) Carnegie Mellon University 2D Image Transforms 16-385 Computer Vision (Kris Kitani) Carnegie Mellon University Extract features from an image what do we do next? Feature matching (object recognition, 3D reconstruction, augmented

More information

Orthogonal Projection Matrices. Angel and Shreiner: Interactive Computer Graphics 7E Addison-Wesley 2015

Orthogonal Projection Matrices. Angel and Shreiner: Interactive Computer Graphics 7E Addison-Wesley 2015 Orthogonal Projection Matrices 1 Objectives Derive the projection matrices used for standard orthogonal projections Introduce oblique projections Introduce projection normalization 2 Normalization Rather

More information

Computer Viewing. CS 537 Interactive Computer Graphics Prof. David E. Breen Department of Computer Science

Computer Viewing. CS 537 Interactive Computer Graphics Prof. David E. Breen Department of Computer Science Computer Viewing CS 537 Interactive Computer Graphics Prof. David E. Breen Department of Computer Science 1 Objectives Introduce the mathematics of projection Introduce OpenGL viewing functions Look at

More information

Lecture 4: Transformations and Matrices. CSE Computer Graphics (Fall 2010)

Lecture 4: Transformations and Matrices. CSE Computer Graphics (Fall 2010) Lecture 4: Transformations and Matrices CSE 40166 Computer Graphics (Fall 2010) Overall Objective Define object in object frame Move object to world/scene frame Bring object into camera/eye frame Instancing!

More information

CSCI-4530/6530 Advanced Computer Graphics

CSCI-4530/6530 Advanced Computer Graphics Luo Jr. CSCI-453/653 Advanced Computer Graphics http://www.cs.rpi.edu/~cutler/classes/advancedgraphics/s7/ Barb Cutler cutler@cs.rpi.edu MRC 33A Piar Animation Studios, 986 Topics for the Semester Meshes

More information

Object Representation Affine Transforms. Polygonal Representation. Polygonal Representation. Polygonal Representation of Objects

Object Representation Affine Transforms. Polygonal Representation. Polygonal Representation. Polygonal Representation of Objects Object Representation Affine Transforms Polygonal Representation of Objects Although perceivable the simplest form of representation they can also be the most problematic. To represent an object polygonally,

More information

Section III: TRANSFORMATIONS

Section III: TRANSFORMATIONS Section III: TRANSFORMATIONS in 2-D 2D TRANSFORMATIONS AND MATRICES Representation of Points: 2 x 1 matrix: X Y General Problem: [B] = [T] [A] [T] represents a generic operator to be applied to the points

More information

Affine Transformation. Edith Law & Mike Terry

Affine Transformation. Edith Law & Mike Terry Affine Transformation Edith Law & Mike Terry Graphic Models vs. Images Computer Graphics: the creation, storage and manipulation of images and their models Model: a mathematical representation of an image

More information

CS451Real-time Rendering Pipeline

CS451Real-time Rendering Pipeline 1 CS451Real-time Rendering Pipeline JYH-MING LIEN DEPARTMENT OF COMPUTER SCIENCE GEORGE MASON UNIVERSITY Based on Tomas Akenine-Möller s lecture note You say that you render a 3D 2 scene, but what does

More information

Today. Rendering algorithms. Rendering algorithms. Images. Images. Rendering Algorithms. Course overview Organization Introduction to ray tracing

Today. Rendering algorithms. Rendering algorithms. Images. Images. Rendering Algorithms. Course overview Organization Introduction to ray tracing Today Rendering Algorithms Course overview Organization Introduction to ray tracing Spring 2010 Matthias Zwicker Universität Bern Rendering algorithms Problem statement Given computer representation of

More information

CS 4204 Computer Graphics

CS 4204 Computer Graphics CS 4204 Computer Graphics 3D Viewing and Projection Yong Cao Virginia Tech Objective We will develop methods to camera through scenes. We will develop mathematical tools to handle perspective projection.

More information

C O M P U T E R G R A P H I C S. Computer Graphics. Three-Dimensional Graphics I. Guoying Zhao 1 / 52

C O M P U T E R G R A P H I C S. Computer Graphics. Three-Dimensional Graphics I. Guoying Zhao 1 / 52 Computer Graphics Three-Dimensional Graphics I Guoying Zhao 1 / 52 Geometry Guoying Zhao 2 / 52 Objectives Introduce the elements of geometry Scalars Vectors Points Develop mathematical operations among

More information

Computer Science 336 Fall 2017 Homework 2

Computer Science 336 Fall 2017 Homework 2 Computer Science 336 Fall 2017 Homework 2 Use the following notation as pseudocode for standard 3D affine transformation matrices. You can refer to these by the names below. There is no need to write out

More information

Drawing in 3D (viewing, projection, and the rest of the pipeline)

Drawing in 3D (viewing, projection, and the rest of the pipeline) Drawing in 3D (viewing, projection, and the rest of the pipeline) CS559 Spring 2016 Lecture 6 February 11, 2016 The first 4 Key Ideas 1. Work in convenient coordinate systems. Use transformations to get

More information

For each question, indicate whether the statement is true or false by circling T or F, respectively.

For each question, indicate whether the statement is true or false by circling T or F, respectively. True/False For each question, indicate whether the statement is true or false by circling T or F, respectively. 1. (T/F) Rasterization occurs before vertex transformation in the graphics pipeline. 2. (T/F)

More information

Geometry: Outline. Projections. Orthographic Perspective

Geometry: Outline. Projections. Orthographic Perspective Geometry: Cameras Outline Setting up the camera Projections Orthographic Perspective 1 Controlling the camera Default OpenGL camera: At (0, 0, 0) T in world coordinates looking in Z direction with up vector

More information

COMP3421. Introduction to 3D Graphics

COMP3421. Introduction to 3D Graphics COMP3421 Introduction to 3D Graphics 3D coodinates Moving to 3D is simply a matter of adding an extra dimension to our points and vectors: 3D coordinates 3D coordinate systems can be left or right handed.

More information

Announcements. Submitting Programs Upload source and executable(s) (Windows or Mac) to digital dropbox on Blackboard

Announcements. Submitting Programs Upload source and executable(s) (Windows or Mac) to digital dropbox on Blackboard Now Playing: Vertex Processing: Viewing Coulibaly Amadou & Mariam from Dimanche a Bamako Released August 2, 2005 Rick Skarbez, Instructor COMP 575 September 27, 2007 Announcements Programming Assignment

More information

Computer Graphics Geometric Transformations

Computer Graphics Geometric Transformations Computer Graphics 2016 6. Geometric Transformations Hongxin Zhang State Key Lab of CAD&CG, Zhejiang University 2016-10-31 Contents Transformations Homogeneous Co-ordinates Matrix Representations of Transformations

More information

Today s Topics. 3. Transformations in 2D. 4. Coordinate-free geometry. 5. 3D Objects (curves & surfaces) 6. Transformations in 3D

Today s Topics. 3. Transformations in 2D. 4. Coordinate-free geometry. 5. 3D Objects (curves & surfaces) 6. Transformations in 3D Today s Topics 3. Transformations in 2D 4. Coordinate-free geometry 5. 3D Objects (curves & surfaces) 6. Transformations in 3D Topic 3: 2D Transformations Simple Transformations Homogeneous coordinates

More information

CS354 Computer Graphics Rotations and Quaternions

CS354 Computer Graphics Rotations and Quaternions Slide Credit: Don Fussell CS354 Computer Graphics Rotations and Quaternions Qixing Huang April 4th 2018 Orientation Position and Orientation The position of an object can be represented as a translation

More information

Computer Science 426 Midterm 3/11/04, 1:30PM-2:50PM

Computer Science 426 Midterm 3/11/04, 1:30PM-2:50PM NAME: Login name: Computer Science 46 Midterm 3//4, :3PM-:5PM This test is 5 questions, of equal weight. Do all of your work on these pages (use the back for scratch space), giving the answer in the space

More information

Perspective projection and Transformations

Perspective projection and Transformations Perspective projection and Transformations The pinhole camera The pinhole camera P = (X,,) p = (x,y) O λ = 0 Q λ = O λ = 1 Q λ = P =-1 Q λ X = 0 + λ X 0, 0 + λ 0, 0 + λ 0 = (λx, λ, λ) The pinhole camera

More information

CMSC427 Transformations II: Viewing. Credit: some slides from Dr. Zwicker

CMSC427 Transformations II: Viewing. Credit: some slides from Dr. Zwicker CMSC427 Transformations II: Viewing Credit: some slides from Dr. Zwicker What next? GIVEN THE TOOLS OF The standard rigid and affine transformations Their representation with matrices and homogeneous coordinates

More information

Transformation Algebra

Transformation Algebra Transformation Algebra R. J. Renka Department of Computer Science & Engineering University of North Texas 0/07/205 Linear Transformations A point with Cartesian coordinates (x, y, z) is taken to be a column

More information

Transformations Week 9, Lecture 18

Transformations Week 9, Lecture 18 CS 536 Computer Graphics Transformations Week 9, Lecture 18 2D Transformations David Breen, William Regli and Maxim Peysakhov Department of Computer Science Drexel University 1 3 2D Affine Transformations

More information

3D Viewing Episode 2

3D Viewing Episode 2 3D Viewing Episode 2 1 Positioning and Orienting the Camera Recall that our projection calculations, whether orthographic or frustum/perspective, were made with the camera at (0, 0, 0) looking down the

More information

Lecture 3 Sections 2.2, 4.4. Mon, Aug 31, 2009

Lecture 3 Sections 2.2, 4.4. Mon, Aug 31, 2009 Model s Lecture 3 Sections 2.2, 4.4 World s Eye s Clip s s s Window s Hampden-Sydney College Mon, Aug 31, 2009 Outline Model s World s Eye s Clip s s s Window s 1 2 3 Model s World s Eye s Clip s s s Window

More information

Graphics Pipeline 2D Geometric Transformations

Graphics Pipeline 2D Geometric Transformations Graphics Pipeline 2D Geometric Transformations CS 4620 Lecture 8 1 Plane projection in drawing Albrecht Dürer 2 Plane projection in drawing source unknown 3 Rasterizing triangles Summary 1 evaluation of

More information

Computer Graphics: Viewing in 3-D. Course Website:

Computer Graphics: Viewing in 3-D. Course Website: Computer Graphics: Viewing in 3-D Course Website: http://www.comp.dit.ie/bmacnamee 2 Contents Transformations in 3-D How do transformations in 3-D work? 3-D homogeneous coordinates and matrix based transformations

More information

CT5510: Computer Graphics. Transformation BOCHANG MOON

CT5510: Computer Graphics. Transformation BOCHANG MOON CT5510: Computer Graphics Transformation BOCHANG MOON 2D Translation Transformations such as rotation and scale can be represented using a matrix M.., How about translation? No way to express this using

More information

The Graphics Pipeline and OpenGL I: Transformations!

The Graphics Pipeline and OpenGL I: Transformations! ! The Graphics Pipeline and OpenGL I: Transformations! Gordon Wetzstein! Stanford University! EE 267 Virtual Reality! Lecture 2! stanford.edu/class/ee267/!! Albrecht Dürer, Underweysung der Messung mit

More information

Chapter 5. Projections and Rendering

Chapter 5. Projections and Rendering Chapter 5 Projections and Rendering Topics: Perspective Projections The rendering pipeline In order to view manipulate and view a graphics object we must find ways of storing it a computer-compatible way.

More information

Graphics pipeline and transformations. Composition of transformations

Graphics pipeline and transformations. Composition of transformations Graphics pipeline and transformations Composition of transformations Order matters! ( rotation * translation translation * rotation) Composition of transformations = matrix multiplication: if T is a rotation

More information

3D Graphics for Game Programming (J. Han) Chapter II Vertex Processing

3D Graphics for Game Programming (J. Han) Chapter II Vertex Processing Chapter II Vertex Processing Rendering Pipeline Main stages in the pipeline The vertex processing stage operates on every input vertex stored in the vertex buffer and performs various operations such as

More information

2D and 3D Transformations AUI Course Denbigh Starkey

2D and 3D Transformations AUI Course Denbigh Starkey 2D and 3D Transformations AUI Course Denbigh Starkey. Introduction 2 2. 2D transformations using Cartesian coordinates 3 2. Translation 3 2.2 Rotation 4 2.3 Scaling 6 3. Introduction to homogeneous coordinates

More information

Lecture 6 Sections 4.3, 4.6, 4.7. Wed, Sep 9, 2009

Lecture 6 Sections 4.3, 4.6, 4.7. Wed, Sep 9, 2009 Lecture 6 Sections 4.3, 4.6, 4.7 Hampden-Sydney College Wed, Sep 9, 2009 Outline 1 2 3 4 re are three mutually orthogonal axes: the x-axis, the y-axis, and the z-axis. In the standard viewing position,

More information

Viewing. Reading: Angel Ch.5

Viewing. Reading: Angel Ch.5 Viewing Reading: Angel Ch.5 What is Viewing? Viewing transform projects the 3D model to a 2D image plane 3D Objects (world frame) Model-view (camera frame) View transform (projection frame) 2D image View

More information

3D Viewing Episode 2

3D Viewing Episode 2 3D Viewing Episode 2 1 Positioning and Orienting the Camera Recall that our projection calculations, whether orthographic or frustum/perspective, were made with the camera at (0, 0, 0) looking down the

More information

Today. Parity. General Polygons? Non-Zero Winding Rule. Winding Numbers. CS559 Lecture 11 Polygons, Transformations

Today. Parity. General Polygons? Non-Zero Winding Rule. Winding Numbers. CS559 Lecture 11 Polygons, Transformations CS559 Lecture Polygons, Transformations These are course notes (not used as slides) Written by Mike Gleicher, Oct. 005 With some slides adapted from the notes of Stephen Chenney Final version (after class)

More information

Introduction to Homogeneous coordinates

Introduction to Homogeneous coordinates Last class we considered smooth translations and rotations of the camera coordinate system and the resulting motions of points in the image projection plane. These two transformations were expressed mathematically

More information

Affine Transformations in 3D

Affine Transformations in 3D Affine Transformations in 3D 1 Affine Transformations in 3D 1 Affine Transformations in 3D General form 2 Translation Elementary 3D Affine Transformations 3 Scaling Around the Origin 4 Along x-axis Shear

More information

Lecture 5: Transforms II. Computer Graphics and Imaging UC Berkeley CS184/284A

Lecture 5: Transforms II. Computer Graphics and Imaging UC Berkeley CS184/284A Lecture 5: Transforms II Computer Graphics and Imaging UC Berkeley 3D Transforms 3D Transformations Use homogeneous coordinates again: 3D point = (x, y, z, 1) T 3D vector = (x, y, z, 0) T Use 4 4 matrices

More information

Three Main Themes of Computer Graphics

Three Main Themes of Computer Graphics Three Main Themes of Computer Graphics Modeling How do we represent (or model) 3-D objects? How do we construct models for specific objects? Animation How do we represent the motion of objects? How do

More information

METR Robotics Tutorial 2 Week 2: Homogeneous Coordinates

METR Robotics Tutorial 2 Week 2: Homogeneous Coordinates METR4202 -- Robotics Tutorial 2 Week 2: Homogeneous Coordinates The objective of this tutorial is to explore homogenous transformations. The MATLAB robotics toolbox developed by Peter Corke might be a

More information

The Graphics Pipeline and OpenGL I: Transformations!

The Graphics Pipeline and OpenGL I: Transformations! ! The Graphics Pipeline and OpenGL I: Transformations! Gordon Wetzstein! Stanford University! EE 267 Virtual Reality! Lecture 2! stanford.edu/class/ee267/!! Logistics Update! all homework submissions:

More information

COMP3421. Introduction to 3D Graphics

COMP3421. Introduction to 3D Graphics COMP3421 Introduction to 3D Graphics 3D coordinates Moving to 3D is simply a matter of adding an extra dimension to our points and vectors: 3D coordinates 3D coordinate systems can be left or right handed.

More information

INTRODUCTION TO COMPUTER GRAPHICS. cs123. It looks like a matrix Sort of. Viewing III. Projection in Practice 1 / 52

INTRODUCTION TO COMPUTER GRAPHICS. cs123. It looks like a matrix Sort of. Viewing III. Projection in Practice 1 / 52 It looks like a matrix Sort of Viewing III Projection in Practice 1 / 52 Arbitrary 3D views } view volumes/frusta spec d by placement and shape } Placement: } Position (a point) } look and up vectors }

More information

(Refer Slide Time: 00:04:20)

(Refer Slide Time: 00:04:20) Computer Graphics Prof. Sukhendu Das Dept. of Computer Science and Engineering Indian Institute of Technology, Madras Lecture 8 Three Dimensional Graphics Welcome back all of you to the lectures in Computer

More information