Presentation is loading. Please wait.

Presentation is loading. Please wait.

with Applications in Computer Graphics

Similar presentations


Presentation on theme: "with Applications in Computer Graphics"— Presentation transcript:

1 with Applications in Computer Graphics
Matrix Operations with Applications in Computer Graphics

2 Special Matrices The zero matrix is a matrix with all zero entries.
The identity matrix is the matrix I with 1 on the main diagonal entries and 0 for all other entries. A diagonal matrix D = [dij] has the property that dij=0 when i not equal to j. Sometimes we use the notation D = diag{a,b,c}.

3 Matrix Multiplication Examples

4 Linear Transformation
A matrix M : R3 -> R3 is called a linear transformation and maps vectors to vectors by Y=MX. The term linearity refers to the property that M(cU +V) = cMU + MV for any scalar c and any vectors U and V.

5 Matrix Transpose The transpose of a matrix M = [mij] is the matrix MT = [mji].  That is the rows and columns are interchanged in MT (or the matrix is flipped about its main diagonal).

6 Skew (Anti-) Symmetric
A matrix M  is symmetric if M=MT. A matrix M is skew-symmetric if MT= -M.

7 Computer Graphics Computer graphics is a study of the use of a computer to create and manipulate images and animated scenes, usually represented in three dimensions. A mathematical model of a three dimensional world uses vectors to describe the locations and material properties of objects and their relationships. An observer's location and line of sight are used to generate a perspective view of this mathematical model.

8 Scaling If a diagonal matrix D = diag{d0, d1, d2} has all positive entries, it is a scaling matrix.  Each diagonal term represents how much stretching or shrinking occurs for the corresponding coordinate direction.  Uniform scaling is D = sI = diag{s,s,s} for s>0.

9 An Invertible Matrix A matrix is said to be invertible if there exists a matrix, M-1 such that MM-1 = M-1M = I.

10 R = I + (sin f) S + (1 - cos f) S2
Rotation A matrix R is a rotation matrix if its transpose and inverse are the same matrix,  that is, R-1 = RT, in which case RRT = RTR = I.  The matrix has a corresponding unit-length axis of rotation U and angle of rotation f.  The choice is not unique since -U is also an axis of rotation and f + 2pk for any integer k is an angle of rotation.  If U=(u0,u1,u2), we can define the skew-symmetric matrix S by The rotation corresponding to axis U and angle f is R = I + (sin f) S + (1 - cos f) S2

11 Translation Translation of vectors by a fixed vector T element of R3 is represented by the function Y = X + T for X and Y elements of R3.  It is not possible to represent this translation as a linear transformation of the form Y = MX for some constant matrix M.  However, if the problem is embedded in a four-dimensional space, it is possible to represent translation with a linear transformation (called a homogeneous transformation). ref: 3D Game Engine Design, by David H. Eberly, Morgan Kaufmann

12 Orthographic Projection
Vector Model Orthographic Projection Shutterbug: Copyright 1990 Pixar - Rendered by Thomas Williams and H. B. Siegel using Pixar's RenderManTM

13 Perspective Projection
Shutterbug: Copyright 1990 Pixar - Rendered by Thomas Williams and H. B. Siegel using Pixar's RenderManTM

14 Depth Cueing Shutterbug: Copyright 1990 Pixar - Rendered by Thomas Williams and H. B. Siegel using Pixar's RenderManTM

15 Depth Clipping Shutterbug: Copyright 1990 Pixar - Rendered by Thomas Williams and H. B. Siegel using Pixar's RenderManTM

16 Color Vectors Shutterbug: Copyright 1990 Pixar - Rendered by Thomas Williams and H. B. Siegel using Pixar's RenderManTM

17 Visible Line Determination
Shutterbug: Copyright 1990 Pixar - Rendered by Thomas Williams and H. B. Siegel using Pixar's RenderManTM

18 Ambient Illumination Only
Shutterbug: Copyright 1990 Pixar - Rendered by Thomas Williams and H. B. Siegel using Pixar's RenderManTM

19 Polygon Shading Shutterbug: Copyright 1990 Pixar - Rendered by Thomas Williams and H. B. Siegel using Pixar's RenderManTM

20 Gouraud Shading Shutterbug: Copyright 1990 Pixar - Rendered by Thomas Williams and H. B. Siegel using Pixar's RenderManTM

21 Gouraud Shading with Specular Reflection
Shutterbug: Copyright 1990 Pixar - Rendered by Thomas Williams and H. B. Siegel using Pixar's RenderManTM

22 Phong Shading with Specular Reflection
Shutterbug: Copyright 1990 Pixar - Rendered by Thomas Williams and H. B. Siegel using Pixar's RenderManTM

23 Curved Surfaces Shutterbug: Copyright 1990 Pixar - Rendered by Thomas Williams and H. B. Siegel using Pixar's RenderManTM

24 Local Lighing Sources Shutterbug: Copyright 1990 Pixar - Rendered by Thomas Williams and H. B. Siegel using Pixar's RenderManTM

25 Texture Mapping Shutterbug: Copyright 1990 Pixar - Rendered by Thomas Williams and H. B. Siegel using Pixar's RenderManTM

26 Displacement Mapping Shutterbug: Copyright 1990 Pixar - Rendered by Thomas Williams and H. B. Siegel using Pixar's RenderManTM

27 Reflection Mapping Shutterbug: Copyright 1990 Pixar - Rendered by Thomas Williams and H. B. Siegel using Pixar's RenderManTM

28 Homogeneous Transformations
A vector (x,y,z) e R3 can be mapped uniquely onto a vector (x,y,z,1) e R4.  Other vectors (x,y,z,w) e R4  can be projected onto the hyperplane w=1 by (x,y,z,w) -> (x/w,y/w,z/w,1).  An entire line of points with with origin (0,0,0,0) is projected onto the single point (x,y,z,1)  All of R4 \ ={0} is partitioned into equivalence classes, each class having representative projection (x,y,z,1).  A 4-tuple in this setting is called a homogeneous coordinate.  Two homogeneous coordinates that are equivalent are indicated to be so by (x0,y0,z0,w0)~(x1,y1,z1,w1).

29 Transformations can be applied to homogeneous coordinates to obtain other homogeneous coordinates.  Such a 4x4 matrix H = [hij], 0 <= i <= 3 and 0 <=j<=3, is called a homogeneous transformation as long as h33=1.  Usually, homogeneous matrices are written as 2x2 block matrices, where M is a 3x3 matrix, T is 3x1  ST is 1x3 and 1 is a scalar.  The product of a homogeneous coordinate and a homogeneous transformation in block format is,

30 Perspective Transformations
Any 3x3 linear transformation M can be represented by the homogeneous matrix Translation by a vector T can also be represented by a homogeneous transformation, The two transformations can be composed to represent Y = MX + T as Assuming M is invertible, the equation can be solved for X = M-1(Y-T).  Thus, the inverse of a homogeneous matrix is

31 Perspective projection can also be represented by a homogenoeous matrix where the lower-left entry is not the zero vector.  We usually discuss the geometric pipeline in terms of products of homogeneous transformations.  That notation is a convenience and is not particularly useful in an implementation unless the underlying hardware (and/or graphics package) has native support for vector and matrix operations in four dimensions (e.g. openGL and SGI).


Download ppt "with Applications in Computer Graphics"

Similar presentations


Ads by Google