0% found this document useful (0 votes)
39 views1 page

Poster

This document discusses how linear algebra concepts like matrix multiplication can be used in computer graphics applications. Specifically, it explains how rotation matrices can be used to rotate 3D objects by multiplying the vertex vectors by a rotation matrix. It also discusses how homogeneous coordinates can allow translations to be represented as linear transformations using matrices. Finally, it provides an example of how mass-spring systems and Newton's laws can be used in cloth simulation through modeling cloth as a grid of connected point masses.

Uploaded by

nazmussadiq
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views1 page

Poster

This document discusses how linear algebra concepts like matrix multiplication can be used in computer graphics applications. Specifically, it explains how rotation matrices can be used to rotate 3D objects by multiplying the vertex vectors by a rotation matrix. It also discusses how homogeneous coordinates can allow translations to be represented as linear transformations using matrices. Finally, it provides an example of how mass-spring systems and Newton's laws can be used in cloth simulation through modeling cloth as a grid of connected point masses.

Uploaded by

nazmussadiq
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Linear Algebra in Computer Graphics

Adib Farhan
ID : 200041203
Department of Computer Science and Engineering,
Islamic University of Technology, Gazipur

We can do it by multiplying the vectors which represent the It is to be noted that we used three different rotation matrix for
Abstract vertices of the object by the Rotation matrix R. So,
     
overall rotation of the object. However, we can always multiply
cos(θ) −sin(θ) x

 xcos(θ) − ysin(θ)









 them to get a single NOT LOOKING NICE matrix.
Computer graphics, production of images on computers for use Rv = =
     
     
     

sin(θ) cos(θ) y xsin(θ) + ycos(θ)


     
     
     

in any medium. Images used in the graphic design of printed


material are frequently produced on computers, as are the still Translation Application in Computer Graphics
and moving images seen in comic strips and animations. The Manipulating graphics objects using matrix multiplication is
realistic images viewed and manipulated in electronic games very convenient. However, there is a common operation that is One of the biggest application of linear algebra is simulation.
and computer simulations could not be created or supported not a linear transformation: translation - that is, motion. Recall For example, cloth simulation. There are different methods to
without the enhanced capabilities of modern computer graph- that a transformation T (x) is linear if T (x + y) = T (x) + T (y) animate cloth. Mass spring system is one of them.
ics. Computer graphics also are essential to scientific and T (cx) = cT (x). If T (x) is a translation, then T (x) = x+b
for some b. But then T (x+y) ̸= T (x)+T (y). There is a nice
way to avoid this difficulty, while keeping things linear. We will
use what are called homogeneous coordinates. That is, adding
another coordinate.  

x  

We will identify each point ∈ R2 with a corresponding point


 
 
 
 

y
 
 
 
 





x 



 Figure 2: Mass spring system.[2]
y ∈ R3. The coordinates of the point in R3 are the homoge-
 
 
 
 
 
 

visualization, a discipline that uses images and colours to model Here, the cloth is divided into n × m masses. Newton’s 2nd
 

1
 
 
 

complex phenomena such as air currents and electric fields, and neous coordinates for the point in R2. The extra component law applied to that n × m array of point masses, where each
to computer-aided engineering and design, in which objects are gives us a constant that we can scale and add to the other co- mass is connected to its eight nearest neighbours through lin-
drawn and analyzed in computer programs. [1] One of the great- ordinates, as needed, via matrix multiplication. So, our trans- ear springs and dashpot dampers [3]. The system of equations
est tool in computer graphics is matrix and its manipulation. lation matrix for moving the vector dx and dy along the x-axis is solved using the explicit Beeman integration algorithm. The
and the y-axis respectively would be, simulation is fully interactive, each mass can be picked and
Linear Transformations  
pulled around.
1 0 dx 








T = 0 1 dy
 
 
 
 

Scaling
 
 
 

00 1
 
 
 

Let’s say we have some vectors in x-y plane, and we want to


scale them in such a way that the ratio between any two vec-
So, we can easily move a vector v by multiplying it with T as
tors remains the same before and after scaling. The simplest
follows,
way to do that is to use a matrix S. Where,      

1 0 dx x





x + dx 























Tv = 0 1 dy y = y + dy
     
       
     

α 0
     
       
       

S=
       

00 1 1 1
     

Figure 3: Mass spring system.[4]


       
 
     
0 β
 
 
 

This means for 2D graphics, all transformation matrices are


3x3. A BEAUTIFUL equation for Mass Spring System,
Any vector, if multiplied with S, will be scaled by α along x-axis PN ri−rj
So far, we have only talked about the coordinates in 2D plane. ∂2 ri
= − 1
( (k j(||r − r || − L j) + c j(( ∂ri
and β along y-axis. For example, ∂t2 mi j=1 ||ri−rj|| i i j i i ∂t −
Now the question is, how should we treat geometric transfor- ∂rj ri−rj
       
∂t )  ||ri−rj|| )) + Fexti)[4]
α 0 x

 αx 
x′ 










 mations in 3D?
Sv = = = ′
       
       
       

0 β y βy y
       
       
       

Just add one more coordinate/axis! To implement the motion, rotation, scaling and shear of the
clothe in mass spring system, the matrices, discussed earlier,
Rotation So, without any further derivations, we can write the matrices are extesively used.
Like scaling matrices, we can also have matrices that can ro- for 3D transformations as follows, Other usage of linear algebra in graphics are Hair Simulation,
tate the vectors around the origin. For example, the follow- Particle Simulation, Convolution etc.
For Scaling and Translation,
ing matrix can rotate any vector around the origin by θ angle
counter-clockwise.    

α 



0 0 0 



10 



0 dx 



   

0 β 0 0 01 0 dy
   
     
   
cos(θ) −sin(θ)




S=



,T =








R=
     

0 0 γ 0 00 1 dz
     
     

sin(θ) cos(θ)
     
     
     
   
   
0 

0 0 1 

00 

0 1 

Consider the following object. We want to rotate it around the Rotation around x-, y-, z- axis couterclockwise and looking
origin by θ counter-clockwise. towards the origin, respectively,
 

1 0




0 0 



 

0 cos(θ) −sin(θ) 0
 
 
 

Rx(θ) = Figure 4: Convolution[5]


 
 
 
 

0 sin(θ) cos(α) 0
 
 
 
 
 
 
 
0 0


0 1 

 
References
cos(ψ)




0 sin(ψ) 0 


[1] https://www.britannica.com/topic/computer-graphics
 

0 1 0 0
 
 
 

Ry(ψ) =
 
 
 

[2] https://www.cs.bu.edu/fac/snyder/cs132-book/
 

−sin(ψ) 0 cos(ψ) 0
 
 
 
 
 
 

L13ComputerGraphics-Spring2021.html
 
0 

0 0 1 

 
[3] A dashpot damper is a mechanical device that resists mo-
cos(ϕ) −sin(ϕ) 0 0



tion via viscous friction


 
 
 

sin(ϕ) cos(ϕ) 0 0
 
 
 

Rz(ϕ) =
 

[4] https://www.youtube.com/watch?v=ib1vmRDs8Vw
 
 
 

0 0 10
 
 
 

[5] https://www.nvidia.com/en-us/glossary/data-science/
 
 
 
 

Figure 1: Rotating around the origin. 0 



0 01 

convolutional-neural-network/

You might also like