Bài giảng Đồ họa hiện thực ảo - Bài 4a: Các phép biến đổi Đồ hoạ - Lê Tấn Hùng
Ví dụ
At each frame of the animation, the
object is transformed, in this case by a
rotation. It could also be transformed
by changing its size (scaling), or its
shape (deforming
(translation).
Further animation effects can be
achieved by not changing the object,
but the way it is viewed (i.e. the
window to viewport transformation) at
each frame (e.g. b
(c) SE/FIT/HUT 2002
Phép biến đổi - Transformations
Trong kỹ thuật đồ hoạ 3 bước: modeling, rendering,
displaying
Với Modeling:
world
coordinate
modeling
viewing
coordinate
(eye coordinate)
Modeling
Viewing
coordinate
transformation
transformation
Phép biến đổi - Transformation
Biến đổi tạo Hoạt cảnh - Animation
4
(c) SE/FIT/HUT 2002
Phép biến đổi Affine
Affine Transformations?
Phép biến đổi Affine
Ví dụ: phép biến đổi tọa độ với chỉ 2 điểm đầu cuối của
đoạn thẳng tạo thành 2 điểm mới mà khi nối chúng với
nhau tạo thành đoạn thẳng mới.
Các điểm nằm trên đoạn thẳng sẽ có kết quả là điểm
qua phép nội suy.
7
(c) SE/FIT/HUT 2002
Phân loại - Transformations
Example: OBJECT TRANSFORMATION
Có 2 cách nhìn trên phép
biến đổi
.4, 2
Object Transformation:
1,1
Coordinate
Transformation
Example: COORDINATE TRANSFORMATION
Mỗi phương pháp có ưu
nhược điểm riêng về bản
chất tương đồng nhau
(1,1)
(1,1)
(c) SE/FIT/HUT 2002
2D Object Transformations
A 2D object transformation alters each point P into a
new point Q using a specific formula or algorithm.
It therefore alters the co-ordinates of P (Px,Py) into
new values which specify point Q (Qx,Qy)
This can be expressed using some function T, that
(c) SE/FIT/HUT 2002
Matrix Representation
If affine transformation T maps P onto Q, then Q is related to P as
follows:
where a, = bc
This gives rise to the following matrix representation:
Q
P
t
a b
x
x
x
+
=
i.e.
Py t y
Q
c d
y
(c) SE/FIT/HUT 2002
y
Phép biến đổi
Phép bất biến
x
z
Phép biến đổi tỉ lệ - Scaling
A scaling change factors, Sx and Sy
Phép biến dạng
or in the y direc
13
(c) SE/FIT/HUT 2002
Affine Transformations
Preservation of lines:
Affine transformations map lines to lines;
Preservation of parallelism
Preservation of proportional distances
Det(M) |;
15
(c) SE/FIT/HUT 2002
Kết hợp các phép biến đổi
Composition of Affine Transforms
Any affine transformation can be
decomposed into elementary
transformations.
Mọi phép biến i phc tp u có
thể tạo thành từ các phép biến đổi cơ
sở như:
Dịch chuyển - Translation
Tỉ lệ - Scaling
Quay- Rotation
Biến dạng - Shearing
(c) SE/FIT/HUT 2002
affine combinations
It is rare that we want to perform just one elementary
transformation.
Usually an application requires that we build a complex
transformation out of several elementary ones
e.g. translate an object, rotate it, and scale it, all in one move
transformation
also an affine transformation
(c) SE/FIT/HUT 2002
Thuộc tính
T
Tác động lên tập các điểm đặc trưng của đối tượng tạo
thành phép biến đổi cho đối tượng
points
18
(c) SE/FIT/HUT 2002
Điểm gốc - Pivotal points
Cho phép quay và tỉ lệ Rotation and Scaling
The simple versions of rotation and scaling have been based around the origin.
This means that when we rotate or scale, the object will also move, with
respect to the origin
Translate all points through (-c1,-c2)
Rotate all points about the origin by
Translate all points back through (c1,c2)
(c1,c2)
(0,0)
(c) SE/FIT/HUT 2002
Pivotal points
Often we wish to rotate or scale with respect to some pivotal
point, not the origin
Most significantly, we often wish to rotate or scale an object
about its centre, or midpoint
In this way, the object’s location does not change
To do this, we relate the rotation or scaling about the pivotal
We then rotate or about the origin
location
(c) SE/FIT/HUT 2002
Tải về để xem bản đầy đủ
Bạn đang xem 20 trang mẫu của tài liệu "Bài giảng Đồ họa hiện thực ảo - Bài 4a: Các phép biến đổi Đồ hoạ - Lê Tấn Hùng", để tải tài liệu gốc về máy hãy click vào nút Download ở trên
File đính kèm:
- bai_giang_do_hoa_hien_thuc_ao_bai_4a_cac_phep_bien_doi_do_ho.pdf