Transformasi 2D
Summary
TLDRIn this video, Yoga introduces fundamental concepts of 2D graphics transformations, focusing on translation, scaling, and rotation. He explains how transformations alter the position, size, and orientation of geometric objects such as triangles using formulas and matrices. The process of translation involves shifting objects along the X and Y axes, scaling changes an object’s size using scaling factors, and rotation alters the object’s orientation around a fixed point. Throughout the lesson, practical examples and mathematical expressions demonstrate how to apply these transformations to objects in computer graphics.
Takeaways
- 😀 **Definition of Transformation in Computer Graphics:** Transformation refers to the process of changing the shape and position of an object in a 2D plane through operations like translation, scaling, and rotation.
- 😀 **Translation (Pergeseran):** Translation moves an object from one place to another without changing its size or shape. The object is shifted by adding a translation vector to its original coordinates.
- 😀 **Translation Formula:** The new position after translation is calculated as X' = X + TX and Y' = Y + TY, where TX and TY are the translation vectors for the X and Y axes.
- 😀 **Scaling (Pembesaran):** Scaling changes the size of an object. This is done by multiplying the object's coordinates by scaling factors along the X and Y axes.
- 😀 **Scaling Formula:** The new position after scaling is calculated as X' = X × SX and Y' = Y × SY, where SX and SY are the scaling factors for the X and Y axes.
- 😀 **Rotation (Pemutaran):** Rotation changes the orientation of an object by turning it around a central point (usually the origin). The rotation can be clockwise or counterclockwise.
- 😀 **Rotation Formula:** The new position after rotation is calculated using the rotation matrix, which involves the cosine and sine of the angle of rotation: X' = X * cos(θ) - Y * sin(θ) and Y' = X * sin(θ) + Y * cos(θ).
- 😀 **Rotation Direction:** Clockwise rotation is negative (counterclockwise is positive). The angle is represented by θ and affects how the object is rotated on the plane.
- 😀 **Example of Translation:** Given the points P(10,10), Q(10,30), and R(30,30) with a translation vector of TX = 20, TY = 20, the new positions would be P'(30,30), Q'(30,50), and R'(50,50).
- 😀 **Example of Scaling:** For the triangle with points A(20, 20), B(100, 200), and C(60, 120), scaling by factors SX = 4 and SY = 2 results in new points A'(80, 40), B'(400, 400), and C'(240, 240).
- 😀 **Example of Rotation:** A triangle with points A(20, 20), B(100, 20), and C(60, 120) rotated 180 degrees counterclockwise will result in A'(-20, -20), B'(-100, -20), and C'(-60, 10).
Q & A
What is the definition of transformation in computer graphics?
-Transformation in computer graphics refers to the process of changing the shape, position, or size of an object. This can involve shifting, resizing, or rotating an object based on mathematical formulas.
What are the key types of transformations discussed in the script?
-The key types of transformations discussed are translation (shifting an object), scaling (changing the size of an object), and rotation (turning an object around a point).
How is translation performed in 2D graphics?
-Translation in 2D graphics is performed by shifting an object along the x and y axes. The formula used is x' = x + Tx and y' = y + Ty, where Tx and Ty are the translation vectors along the respective axes.
What does scaling do to an object in 2D graphics?
-Scaling changes the size of an object in 2D graphics by multiplying its coordinates with a scaling factor. The formula for scaling is x' = x * Sx and y' = y * Sy, where Sx and Sy are the scaling factors along the x and y axes.
How is rotation handled in 2D transformations?
-Rotation in 2D transformations is done by rotating an object around a specific point, typically the origin. The formula used is x' = x * cos(θ) - y * sin(θ) and y' = x * sin(θ) + y * cos(θ), where θ is the angle of rotation.
What happens to an object during translation?
-During translation, an object is moved from one position to another without changing its shape, size, or orientation. All points of the object shift by the same amount.
In the example of translation with a triangle, how do the coordinates change?
-In the example, a triangle with initial coordinates (10,10), (10,30), and (30,30) is translated by a vector (20, 20). The new coordinates are (30,30), (30,50), and (50,50), respectively.
What is the difference between translation and scaling?
-The main difference between translation and scaling is that translation shifts the object without changing its size or shape, while scaling alters the object's size by multiplying its coordinates by a scaling factor.
How does the rotation matrix work in 2D transformations?
-The rotation matrix in 2D transformations is used to calculate the new coordinates of an object after rotation. The matrix includes cos(θ) and sin(θ) values, which help determine how each point of the object is rotated based on the angle θ.
Can you give an example of how scaling is applied to a triangle?
-In the example provided, a triangle with coordinates (20,20), (100,200), and (60,120) is scaled by a factor of Sx = 4 and Sy = 2. The new coordinates after scaling become (80, 40), (400, 400), and (240, 240).
Outlines

This section is available to paid users only. Please upgrade to access this part.
Upgrade NowMindmap

This section is available to paid users only. Please upgrade to access this part.
Upgrade NowKeywords

This section is available to paid users only. Please upgrade to access this part.
Upgrade NowHighlights

This section is available to paid users only. Please upgrade to access this part.
Upgrade NowTranscripts

This section is available to paid users only. Please upgrade to access this part.
Upgrade NowBrowse More Related Video

Grafika Komputer : Pertemuan 7 (Part 1) Transformasi 2D dengan Metode Konvensional

Kelas Grafika Komputer | Transformasi 2D (Metode konvensional)

Quick Understanding of Homogeneous Coordinates for Computer Graphics

Álgebra Linear: Aplicação em TI -Computação Gráfica

TRANSFORMASI FUNGSI PART 1

TRANFORMASI Pergeseran(Translasi), Pencerminan(Refleksi), Perputaran(Rotasi) dan Perkalian(Dilatasi)
5.0 / 5 (0 votes)