Explanation about transformation, matrix representation
Size: 683.53 KB
Language: en
Added: Dec 01, 2022
Slides: 12 pages
Slide Content
COMPUTER GRAPHICS By Ms. N. RUBA Asst. prof/ Computer Applications Bon Secours College for Women, Thanjavur.
TRANSFORMATION ▶ Transformation means a change in the orientation, size, and shape of the object. ▶ They are used to position the object, change the object's shape, a n d e v e n c h a n g e h o w s o m e t h i n g i s v i e w e d . ▶ Transformation plays a major role in computer graphics, repositioning the graphics on the screen and changing their size or orientation.
M a t r i x r e pr e s e n t a t i on ▶ i s a m e t h o d u s e d b y a c o m p u t e r l a n g u a g e t o s t o r e m a t r i c e s o f more than one dimension in memory . Fortran and C use different schemes for their native arrays. Fortran uses "Column Major", in which all the elements for a given column are stored contiguously in memory.
Th e re i s b a s i c g e o m e t ri c a l transformation such as: ▶ Translation ▶ Scaling ▶ Rotation ▶ T h e d e r i v e d g e o m e t r i c a l t r a n s f o r m a t i o n i s : ▶ Reflection ▶ Shearin
Scale Matrix ▶ Now that you have a grasp on how to set up your matrices, let’s move on to actually changing some of the values and see a change to your matrix. The first matrix we talk about is the scale matrix. The scale matrix isn’t much different from the identity matrix. ▶ The scale matrix has all the same zeros as the identity matrix, ▶ [ ▶ Sx ▶ Sy ▶ Sz ▶ ▶ ] 1
S c a l i n g m a t rix i s l oo k l i ke :
T ra n sl a t i o n M a t r i x ▶ The next matrix we talk about is the translation matrix. The translation matrix tweaks the identity matrix somewhat. We already established that the identity matrix returns the same coordinate that you started with. The translation matrix goes a little further and applies a translation value to the coordinate. ▶ The translation matrix looks the same as the identity matrix, but the last column is a little different. ▶ [ ▶ 1 Tx ▶ 1 Ty ▶ 1 Tz ▶ 1 ▶ ]
Translation matrix look like:
Rotation matrix: ▶ It is a process of changing the angle of the object. Rotation can be clockwise or anticlockwise. For rotation, we have to specify the angle of rotation and rotation point. Rotation point is also called a pivot point. It is print about which object is rotated. ▶ T y p e s o f R o t a ti o n : ▶ Anticlockwise ▶ Counterclockwise
D i r e c t i o n s i n r o t a t i o n : M a t r i x f o r r o t a t i o n i s a clockwise direction. i s an Matrix for rotation anticlockwise direction.
▶ An example of a rotation matrix would look something like this: ▶ [ ▶ 1 ▶ cosθ -sinθ ▶ sinθ cosθ ▶ 1 ▶ ] ▶ T h i s m a t r i x d e s c r i b e s a n a n g l e o f ro t a t i o n a rou n d t he x - a x i s . B e c a use t he x - a x i s i s acting as the hinge on the door, it does not change. ▶ You choose the angle you want to rotate the vector by, and the new y and z coordinates are calculated by applying the sine or cosine of the angle of rotation.