[PDF] Matrices in Computer Graphics



Previous PDF Next PDF







Chapter 3 Matrices - Trinity College Dublin

and in general we can have m n matrices for any m 1 and n 1 Matrices with just one row are called row matrices A 1 n matrix [ x 1 x 2 x n] has just the same information in it as an n-tuple (x 1;x 2;:::;x n) 2Rn and so we could be tempted to identify 1 n matrices with n-tuples (which we know are points or vectors in Rn)



Exo7 - Cours de mathématiques

Matrices triangulaires, transposition, trace, matrices symétriques Fiche d'exercices ⁄ Calculs sur les matrices Les matrices sont des tableaux de nombres La résolution d’un certain nombre de problèmes d’algèbre linéaire se ramène à des manipulations sur les matrices Ceci est vrai en particulier pour la résolution des systèmes



Cours 0D : matrices

Cours 0D : matrices 4 Calcul de certaines suites récurrentes : B Soient (xn)n2N et (yn n2N deux suites réelles, vérifiant la relation de récurrence linéaire suivante : pour tout entier n 2N, n x n¯1 ˘ ¡9xn ¡18yn yn¯1 ˘ 6xn ¯12yn avec x0 ˘¡137 et y0 ˘18 Il s’agit de déterminer les termes généraux de ces deux suites en



Définition et opérations sur les matrices

deux matrices de formats respectifs (p,) ( ) Le produit AB est possible, mais le produit BA n’est possible que si mp=, et en général on a AB BA (la multiplication des matrices n’est pas commutative) ATTENTION à l’ordre dans lequel on écrit le produit • La multiplication des matrices est associative c'est-à-dire



Matrices in Computer Graphics

Dec 03, 2001 · The use of matrices in computer graphics is widespread Many industries like architecture, cartoon, automotive that were formerly done by hand drawing now are done routinely with the aid of computer graphics Video gaming industry, maybe the earliest industry to rely heavily on computer graphics, is now representing rendered polygon in 3



Matrices - Mathématiques en ECS1

Exercice 10 2 Pour n= 3, donner des matrices triangulaire supérieure (resp inférieure) et diagonale 10 2Opérations élémentaires sur les matrices Commençons par donner la dé nition intuitive suivante 94 Cours ECS1



ALG 10 Matrices et applications linéaires

somme et le produit de deux matrices, la transposée, donne l’inverse d’une matrice (3,3) à l’aide des cofacteurs et introduit les matrices symétriques et antisymétriques 1 Matrices et applications linéaires Nous allons compléter le cours d’algèbre linéaire en établissant un lien entre les deux points de vue



Calcul matriciel

On définit les matricesA + B et λA par : A+B = (ai,j +bi,j)1ďiďn 1ďjďp et λA = (λai,j)1ďiďn 1ďjďp Définition 9 ⚠ Attention ⚠ On ne peut additionner ou multiplier par une constante que des matrices de même format Exemple 10 (1 e 3 ln2 5 6) + (´2 0 1 0 π ´6) = (´1 e 4 ln2 5+π 0) Exemple 11 i (1+i i 3 ln2 ´i 0) = (i

[PDF] matrice carrée d'ordre 2

[PDF] matrice ligne

[PDF] matrice calcul

[PDF] matrice multiplication

[PDF] comment savoir si il prend du plaisir

[PDF] signes qu'un homme prend du plaisir

[PDF] arts visuels cycle 2 arbre printemps

[PDF] arts visuels arbres cycle 2

[PDF] arbre arts visuels cycle 3

[PDF] arbres arts visuels

[PDF] les arbres en arts plastiques ? l'école

[PDF] arbre arts visuels cycle 2

[PDF] arbre arts plastiques maternelle

[PDF] comment rediger un exercice de math

[PDF] redaction maths prepa

Matrices in Computer Graphics

Ting Yip

Math 308A

12/3/2001

Ting Yip

Math 308A

2 Abstract

In this paper, we discuss and explore the basic matrix operation such as translations, rotations, scaling and we will end the discussion with parallel and perspective view. These concepts commonly appear in video game graphics.

Introduction

The use of matrices in computer graphics is widespread. Many industries like architecture, cartoon, automotive that were formerly done by hand drawing now are done routinely with the aid of computer graphics. Video gaming industry, maybe the earliest industry to rely heavily on computer graphics, is now representing rendered polygon in 3-

Dimensions.

In video gaming industry, matrices are major mathematic tools to construct and manipulate a realistic animation of a polygonal figure. Examples of matrix operations include translations, rotations, and scaling. Other matrix transformation concepts like field of view, rendering, color transformation and projection. Understanding of matrices is a basic necessity to program 3D video games.

Homogeneous Coordinate Transformation

Points (x, y, z) in R3 can be identified as a homogeneous vector ()÷ hy hxhzyxwith h¹0 on the plane in R4. If we convert a 3D point to a 4D vector, we can represent a transformation to this point with a 4 x 4 matrix. The last coordinate is a scalar term. Graphics (Screenshots taken from Operation Flashpoint) Polygon figures like these use many flat or conic surfaces to represent a realistic human soldier.

Ting Yip

Math 308A

3

Transformation of Points

In general, transformation of points can be represented by this equation: Transformed Point = Transformation Matrix ´ Original Point In a more explicit case, a plane spanned by two vectors can be represented by this equation: y x fcebda

Matrixtion Transformaf

ed cba spanMatrixtion TransformaPlane Original Matrix tion Transforma = Plane dTransforme

Representation of a plane using matrices

EXAMPLE

Point (2, 5, 6) in R3 a Vector (2, 5, 6, 1) or (4, 10, 12, 2) in R4 NOTE It is possible to apply transformation to 3D points without converting them to 4D vectors. The tradeoff is that transformation can be done with a single matrix multiplication after the convertion of points to vectors. (More on this after

Translation.) x and y are scalars

c ba ú f ed y cba x f ed

Ting Yip

Math 308A

4 Translation

A translation basically means adding a vector to a point, making a point transforms to a new point. This operation can be simplified as a translation in homogeneous coordinate (x, y, z, 1) to (x + tx, y + ty, z + tz, 1). This transformation can be computed using a single matrix multiplication. Translation Matrix for Homogeneous Coordinates in R4 is given by this matrix:

1000100010001

),,(zyx zyxttt tttT Given any point (x, y, z) in R3, the following will give the translated point.

111000100010001

z yx z y x tztytx z y x t tt

For a sphere to move to a new position, we can think of this as all the points on the sphere move to the

translated sphere by adding the blue vector to each point.

Ting Yip

Math 308A

5

Graphics

(Screenshots taken from Operation Flashpoint) In video game, objects like airplane that doesn't change its shape dynamically (rigid body) uses

Translation to move across the sky. All the points that make up the plane have to be translated by the

same vector or the image of the plane will appear to be stretched. NOTE kzjyix k ji z y x If we have more than one point, we would have to apply this addition to every point. kzkzjyjyixix kzjyix k ji z yx kzjyix k ji z yx zzyyxx

212121

2 22
2 22
1 11 1 11

212121

&aa With homogeneous coordinate, we can use a single matrix multiplication. kzkzjyjyixix kzkzjyjyixix zzyyxx k ji

212121

212121

212121

11111000100010001

As we can see, linear system is easier to solve with homogenenous coordinate transformation.

Ting Yip

Math 308A

6

Scaling

Scaling of any dimension requires one of the diagonal values of the transformation matrix to equal to a value other than one. This operation can be viewed as a scaling in homogeneous coordinate (x, y, z, 1) to (sxx, syy, szz, 1). Values for sx, sy, sz greater than one will enlarge the objects, values between zero and one will shrink the objects, and negative values will rotate the object and change the size of the objects. Scaling Matrix for Homogeneous Coordinates in R4 is given by this matrix:

1000000000000

),,(zyx zyxsss sssS Given any point (x, y, z) in R3, the following will give the scaled point.

111000000000000

zsysxs z yx s ss z yx z yx

If we want to scale the hexahedron proportionally, we apply the same scaling matrix to each point that

makes up the hexahedron.

Ting Yip

Math 308A

7

Rotations

Rotations are defined with respect to an axis. In 3 dimensions, the axis of rotation needs to be specified. A rotation about the x axis is represented by this matrix:

1cossinsincos

110000cossin00sincos00001

1

10000cossin00sincos00001

)(qqqq qqqqqqqqqqzyzyx z y x z y x RRxx A rotation about the y axis is represented by this matrix: A rotation about the z axis is represented by this matrix:

1cossinsincos

11000010000cossin00sincos

1

1000010000cossin00sincos

)(zyxyx z y x z y x

RRzzqqqq

qqqq q qqqq q

1cossinsincos

110000cos0sin00100sin0cos

1

10000cos0sin00100sin0cos

)(qqqq qqqq q qqqq q zxyzx z yx z y x RRyy3D rotation can be viewed as replacing x1 and x2 with two axes.

Ting Yip

Math 308A

8 EXAMPLE

This wire polygon cube is

represented by a matrix that contains its vertex point in every column.

11111111997797793333111175757755

Rotated Cube Original Cube If we want to rotate this cube with respect to the x axis by 3p:

11111111997797793333111175757755

10000

3cos3sin00

3sin3cos00001

pppp - 1 29

23 - 1

27

23 - 1

27

23 - 1

29

23 - 3

27

23 - 3

27

23 - 3

29

23 - 3

29
23
+ 9 21

23 + 7

21

23 + 7

21

23 + 9

21

23 + 7

23

23 + 7

23

23 + 9

23

23 + 9

23
23

11111111

Ting Yip

Math 308A

9

Projection Transformation

Even though we programmed objects in 3-Dimensions, we have to actually view the objects as 2-Dimensions on our computer screens. In another word, we want to transform points in R3 to points in R2.

Parallel Projection

In parallel projection, we simply ignore the z-coordinate. This operation can be viewed as a transformation in homogeneous coordinate (x, y, z, 1) to (x, y, 0, 1). Parallel Matrix for Homogeneous Coordinates in R4 is given by this matrix:

1000000000100001

P Given any point (x, y, z) in R3, the following will give the parallel projected point. 1 0

11000000000100001

yx z y x

Perspective Projection

Video game tends to use perspective projections over other projections to represent a real world, where parallelism is not preserved. Perspective Projections is the way we see things, i.e. bigger when the object is closer.

Ting Yip

Math 308A

10 Important:

1) Translate the eye to the Origin

2) Rotation until direction of eye is toward the negative z-axis

D is the distance of the eye to the view plane

z is the distance of the eye to the object (Note: not your "eyes" but the eyes of the computer polygon person) Perspective Matrix for Homogenous Coordinates in R4 is given by this matrix: ú 0

100000000100001

d Given any point (x, y, z) in R3, the following will give the parallel projected point. ú 1 00 1

0100000000100001

d zydzx d zyx z y x d (Note: This matrix transformation does not give pixel coordinate on the monitor. The transformed

coordinate is with respect to the object's coordinate. We have to translate the object's coordinate to pixel

coordinate on the monitor.)

Eye Object

Perspective Projection of the cube

Ting Yip

Math 308A

11

Conclusion

I chose to do this project to show my curiosity in math and computer science. I had the chance to talk about video games and math that are often overlooked as unrelated. As shown in this project, Linear Algebra is extremely useful for video game graphics. Using matrices to manipulate points is a common mathematical approach in video game graphics.

Graphics

(Screenshots taken from Operation Flashpoint) In sniping mode, the eye moves closer to the object.

Ting Yip

Math 308A

12 References

Dam, Andries. "Introduction to Computer Graphics" Holzschuch, Nicola. "Projections and Perspectives" Lay, David. Linear Algebra and its Applications. Second Edition.

Runwal, Rachana. "Perspective Projection"

quotesdbs_dbs9.pdfusesText_15