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 nd even cha ng e how something is viewed.
▶ Transformation plays a major role in computer graphics,
repositioning the graphics on the screen and changing their size or
orientation.
MATRIX REPRESENTATION
▶ is a method used by a computerla ng uag e to store ma tricesof
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.
THERE IS B A SIC G E O M E TRICA LTRANSFORMATION SUCH AS:
▶ Translation
▶ Scaling
▶ Rotation
▶ The derived g eometricaltra nsformation is:
▶ 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 0 0 0
▶ 0 Sy 0 0
▶ 0 0 Sz 0
▶
▶ ]
0 0 0 1
SCA LING MATRIX IS LOOK LIKE:
TRANSLATION MATRIX
▶ 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 0 0 Tx
▶ 0 1 0 Ty
▶ 0 0 1 Tz
▶ 0 0 0 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
ypes ofR
otation:
▶ Anticlockwise
▶ Counterclockwise
DIRECTIONSINROT
ATION:
Matrix for rotation is a
clockwise direction.
is an
Matrix for rotation
anticlockwise direction.
▶ ANEXAMPLEOFAROTATIONMATRIXWOULD LOOK SOMETHING LIKE THIS:
▶ [
▶ 1 0 0 0
▶ 0 cosθ -sinθ 0
▶ 0 sinθ cosθ 0
▶ 0 0 0 1
▶ ]
▶ This ma trix desc ribes a n a ngle of rota tion a round the x-a xis.Beca use the x-a xis is
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.
THANK YOU
SOMETHING LIKE THIS:

Matrix representation- CG.pptx

  • 1.
    COMPUTER GRAPHICS By Ms. N.RUBA Asst. prof/ Computer Applications Bon Secours College for Women, Thanjavur.
  • 2.
    TRANSFORMATION ▶ Transformation meansa change in the orientation, size, and shape of the object. ▶ They are used to position the object, change the object's shape, a nd even cha ng e how something is viewed. ▶ Transformation plays a major role in computer graphics, repositioning the graphics on the screen and changing their size or orientation.
  • 3.
    MATRIX REPRESENTATION ▶ isa method used by a computerla ng uag e to store ma tricesof 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.
  • 4.
    THERE IS BA SIC G E O M E TRICA LTRANSFORMATION SUCH AS: ▶ Translation ▶ Scaling ▶ Rotation ▶ The derived g eometricaltra nsformation is: ▶ Reflection ▶ Shearin
  • 5.
    SCALE MATRIX ▶ Nowthat 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 0 0 0 ▶ 0 Sy 0 0 ▶ 0 0 Sz 0 ▶ ▶ ] 0 0 0 1
  • 6.
    SCA LING MATRIXIS LOOK LIKE:
  • 7.
    TRANSLATION MATRIX ▶ Thenext 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 0 0 Tx ▶ 0 1 0 Ty ▶ 0 0 1 Tz ▶ 0 0 0 1 ▶ ]
  • 8.
  • 9.
    ROTATION MATRIX: ▶ Itis 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 ypes ofR otation: ▶ Anticlockwise ▶ Counterclockwise
  • 10.
    DIRECTIONSINROT ATION: Matrix for rotationis a clockwise direction. is an Matrix for rotation anticlockwise direction.
  • 11.
    ▶ ANEXAMPLEOFAROTATIONMATRIXWOULD LOOKSOMETHING LIKE THIS: ▶ [ ▶ 1 0 0 0 ▶ 0 cosθ -sinθ 0 ▶ 0 sinθ cosθ 0 ▶ 0 0 0 1 ▶ ] ▶ This ma trix desc ribes a n a ngle of rota tion a round the x-a xis.Beca use the x-a xis is 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.
  • 12.