12.01.2015 Views

Affine Transformations Mô hình hoá - Modelling Ví dụ Phép biến đổi ...

Affine Transformations Mô hình hoá - Modelling Ví dụ Phép biến đổi ...

Affine Transformations Mô hình hoá - Modelling Ví dụ Phép biến đổi ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Khoa CNTT - DDHBK Hà nội<br />

hunglt@it-hut.edu.vn<br />

8682595<br />

Bài 4 Các phép biến đổi Đồ hoạ<br />

<strong>Affine</strong> <strong>Transformations</strong><br />

Le Tan Hung<br />

Email: hunglt@it-hut.edu.vn<br />

I KHái niệm cơ bản<br />

II Các phép biến đổi<br />

III Hệ tọa độ đồng nhất<br />

Mô hình hoá - <strong>Modelling</strong><br />

• Mô hình hoá là tiến trình tạo mới thao<br />

tác trên các mô hình của các đối tượng<br />

hay hệ thống<br />

• Computer graphics ~ quan tâm đến mô<br />

tả hình học của các đối tượng nhằm<br />

cung cấp phương pháp biểu diễn số cho<br />

các hình trên cơ sở về kích thước và các<br />

thuộc tính có liên quan đến tiến trình tô<br />

trát<br />

• Các đối tượng hình học thường được<br />

mô tả bởi các thuật ngữ "thực thể cơ sở"<br />

sub-parts (primitives), như circles, lines<br />

polygons hay cubes<br />

object<br />

• A scene trong đồ họa: chứa các thực<br />

thể đối tượng<br />

Scene Modeling<br />

• Đặt các đối tượng trong cảnh tại các<br />

vị trí khác nhau, thay đổi tỉ lệ và<br />

biến đổi<br />

A scene with several instances of the object<br />

(c) SE/FIT/HUT 2002 1<br />

(c) SE/FIT/HUT 2002 2<br />

Ví dụ<br />

• At each frame of the animation, the<br />

object is transformed, in this case by a<br />

rotation. It could also be transformed<br />

by changing its size (scaling), or its<br />

shape (deforming), or its location<br />

(translation).<br />

• Further animation effects can be<br />

achieved by not changing the object,<br />

but the way it is viewed (i.e. the<br />

window to viewport transformation) at<br />

each frame (e.g. by zooming).<br />

Phép biến đổi - <strong>Transformations</strong><br />

• Trong kỹ thuật đồ hoạ 3 bước: modeling, rendering, displaying<br />

• Với Modeling:<br />

modeling<br />

coordinate Modeling<br />

transformation<br />

world<br />

coordinate<br />

Viewing<br />

transformation<br />

viewing<br />

coordinate<br />

(eye coordinate)<br />

• Transformation: là phép ánh xạ tọa độ điểm hay vector thành tọa độ hay<br />

vector khác<br />

• Biến đổi mô hình hoá - Modeling transformations<br />

• build complex models by positioning simple components<br />

• Biến đổitạo góc nhìn - Viewing transformations<br />

• placing virtual camera in the world<br />

• transformation from world coordinates to camera coordinates<br />

• Biến đổitạo Hoạtcảnh - Animation<br />

• vary transformations over time to create motion<br />

(c) SE/FIT/HUT 2002<br />

(c) SE/FIT/HUT 2002 4<br />

<strong>Transformations</strong> - Modeling<br />

Viewing<br />

<strong>Transformations</strong> - Viewing<br />

world<br />

• Viewing là tiến trình tạo ra góc nhìn của<br />

các mô hình trên màn hình 2D<br />

• Mô tả hình học của các đối tượng<br />

hay các cảnh cung cấp bởi các mô<br />

hình sẽ được chuyển đổi thành tập<br />

các thực thể cơ sở hiển thị.<br />

• Một mô hình có thể quan sát trên các góc<br />

cạnh khác nhau (e.g. faraway, near,<br />

looking down, looking up)<br />

OBJECT<br />

WORLD<br />

CAMERA<br />

(c) SE/FIT/HUT 2002 5<br />

(c) SE/FIT/HUT 2002 6<br />

1


Khoa CNTT - DDHBK Hà nội<br />

hunglt@it-hut.edu.vn<br />

8682595<br />

Phép biến đổi <strong>Affine</strong><br />

<strong>Affine</strong> <strong>Transformations</strong><br />

Phân loại - <strong>Transformations</strong><br />

• Phép biến đổi <strong>Affine</strong> làphépbiến đổitọa độ điểm đặctrưng<br />

của đốitượng thành tập tương ứng các điểmmới để tạo ra các<br />

hiệu ứng cho toàn đốitượng.<br />

• Vídụ: phép biến đổitọa độ vớichỉ 2 điểm đầu cuốicủa đoạn<br />

thẳng tạo thành 2 điểmmới mà khi nối chúng với nhautạo thành<br />

đoạnthẳng mới.<br />

• Các điểmnằmtrênđoạnthẳng sẽ có kếtquả là điểmnằmtrên<br />

đoạnthẳng mớivới cùng phép biến đổi thông qua phép nội<br />

suy.<br />

• Có 2 cách nhìn trên phép biến đổi<br />

• Object Transformation: thay đổi tọa<br />

độ của các điểm theo một số các<br />

quy luật mà không ảnh hưởng đến<br />

hệ tọa độ gốc.<br />

• Coordinate Transformation sinh ra<br />

hệ tọa độ khác và biểu diễn tất các<br />

các đểm trên hệ tọa độ mới đó<br />

• Mỗi phương pháp có ưu nhược điểm riêng<br />

về bản chất gần tương đồng nhau<br />

Example: OBJECT TRANSFORMATION<br />

.4, 2<br />

1,1<br />

Example: COORDINATE TRANSFORMATION<br />

(1,1)<br />

(1,1)<br />

(c) SE/FIT/HUT 2002 7<br />

(c) SE/FIT/HUT 2002<br />

Modeling <strong>Transformations</strong><br />

2D Object <strong>Transformations</strong><br />

Transform objects/points<br />

Transform coordinate system<br />

• A 2D object transformation alters each point P into a<br />

new point Q using a specific formula or algorithm.<br />

• It therefore alters the co-ordinates of P (P x ,P y ) into<br />

new values which specify point Q (Q x ,Q y )<br />

• This can be expressed using some function T, that<br />

maps co-ordinate pairs into co-ordinate pairs:<br />

• T(P x ,P y ) = (Q x ,Q y )<br />

• or:<br />

• T(P) = Q<br />

(c) SE/FIT/HUT 2002 9<br />

(c) SE/FIT/HUT 2002<br />

Matrix Representation<br />

• If affine transformation T maps P onto Q, then Q is related to P as<br />

follows:<br />

Q<br />

x<br />

= aPx<br />

+ bPx<br />

+ tx<br />

•<br />

Q<br />

• y<br />

= cPy<br />

+ dPy<br />

+ t<br />

y<br />

• where a, b, c, d, tx and ty are all constants, and ad = bc<br />

• This gives rise to the following matrix representation:<br />

⎛ Q<br />

x ⎞ ⎛ a b ⎞ ⎛ Px<br />

⎞ ⎛ t<br />

x<br />

• i.e. ⎟ ⎞<br />

⎜ ⎟ = ⎜ ⎟ ⎜ ⎟ + ⎜<br />

⎝ Q<br />

y ⎠ ⎝ c d ⎠ ⎝ P<br />

y ⎠ ⎝ t<br />

y ⎠<br />

Q = MP +<br />

Tr<br />

(c) SE/FIT/HUT 2002<br />

Các phép biến đổi hìnhhọchaichiều<br />

• Phương pháp biểu diễn đốitượng P = [ x y ]<br />

• Phép biến đổivị trí điểm ⎡a<br />

b⎤<br />

T = ⎢ ⎥<br />

⎣c<br />

d ⎦<br />

• Thực thi phép biến đổi đúng trên 1 điểm ảnh sẽ đúng trên toàn bộ đối<br />

tượng<br />

z<br />

⎡a<br />

b ⎤<br />

X * ⎢<br />

= x<br />

c d<br />

⎥<br />

⎣ ⎦<br />

[ ] [ T ] = [ x y] * = ( ax + cy ) ( bx + dy )<br />

y<br />

p M<br />

x<br />

p W<br />

[ ] [ ]<br />

' y '<br />

(c) SE/FIT/HUT 2002 12<br />

2


Khoa CNTT - DDHBK Hà nội<br />

hunglt@it-hut.edu.vn<br />

8682595<br />

Phép biến đổi<br />

y<br />

Phép quay- Rotation<br />

• Phép bấtbiến<br />

⎡1<br />

T = ⎢<br />

⎣0<br />

• Phép biến đổitỉ lệ - Scaling<br />

0⎤<br />

1<br />

⎥<br />

⎦<br />

• A scaling changes the size of an object with two scale factors, S x and S y<br />

[ X ]*[ T ] = [ x<br />

⎡a<br />

0⎤<br />

y] * ⎢ [( )<br />

0 1<br />

⎥ = ax<br />

⎣ ⎦<br />

y] = [ x'<br />

y'<br />

]<br />

• Phép biếndạng<br />

• A shearing shears an object in a particular direction, (in 2D, it’s either in the x<br />

or in the y direction<br />

⎡1<br />

b⎤<br />

⎢<br />

⎣0<br />

1<br />

⎥<br />

⎦<br />

[ X ]*[ T ] = [ x y] * = [ bx + dy] = [ x'<br />

y'<br />

]<br />

z<br />

x<br />

x = ρ cos α, y = ρ sin α ;<br />

x’ = ρ cos (θ +α ), y’ = ρ sin (θ +α )<br />

;<br />

x’ = ρ ( cosθ cosα - sinθ sinα )<br />

= x cosθ -y sinθ<br />

y’ = ρ ( sinθ cosα + cosθ sinα )<br />

= x sinθ + y cosθ<br />

[x' y']= [xcosθ -ysinθ xsinθ +<br />

ycosθ]<br />

⎡ cosθ<br />

[T ] = ⎢<br />

⎣−<br />

sinθ<br />

sinθ<br />

⎤<br />

cosθ<br />

⎥<br />

⎦<br />

y<br />

( x’, y’ )<br />

ρ<br />

ρ<br />

θ<br />

α<br />

( x, y )<br />

x<br />

(c) SE/FIT/HUT 2002 13<br />

(c) SE/FIT/HUT 2002 14<br />

Thuộc tính cơ bản của phép biến đổi<br />

<strong>Affine</strong> <strong>Transformations</strong><br />

• Preservation of lines:<br />

• They preserve lines, so the image of a straight line is another straight line.<br />

• This vastly simplifies drawing transformed line segments.<br />

• We need only compute the image of the two endpoints of the original line<br />

and then draw a straight line between them<br />

• Preservation of collinearity guarantees that polygons will transform into<br />

polygons<br />

• <strong>Affine</strong> transformations map lines to lines;<br />

Thuộc tính<br />

• Preservation of parallelism<br />

• Preservation of parallelism guarantees that parallelograms will transform<br />

into parallelograms<br />

• Preservation of proportional distances<br />

• Preservation of proportional distances means that mid-points of lines<br />

remain mid-points<br />

• <strong>Affine</strong> transformations change volume by | Det(M) |;<br />

(c) SE/FIT/HUT 2002 15<br />

(c) SE/FIT/HUT 2002<br />

Kết hợp các phép biến đổi<br />

Composition of <strong>Affine</strong> Transforms<br />

• Any affine transformation can be<br />

decomposed into elementary<br />

transformations.<br />

• Mọi phép biến đổiphứctạp đều có<br />

thể tạo thànhtừ các phép biến đổicơ<br />

sở như:<br />

• Dịch chuyển - Translation<br />

• Tỉ lệ - Scaling<br />

• Quay- Rotation<br />

• Biến dạng - Shearing<br />

<strong>Affine</strong> transformations preserve<br />

affine combinations<br />

• It is rare that we want to perform just one elementary<br />

transformation.<br />

• Usually an application requires that we build a complex<br />

transformation out of several elementary ones<br />

• e.g. translate an object, rotate it, and scale it, all in one move<br />

• These individual transformations combine into one overall<br />

transformation<br />

• This is called the composition of transformations.<br />

• The composition of two or more affine transformations is<br />

also an affine transformation<br />

(c) SE/FIT/HUT 2002<br />

(c) SE/FIT/HUT 2002<br />

3


Khoa CNTT - DDHBK Hà nội<br />

hunglt@it-hut.edu.vn<br />

8682595<br />

Thuộc tính<br />

• Tác động lên tập các điểm đặc trưng của đối tượng tạo thành<br />

phép biến đổi cho đối tượng<br />

• We have defined each transformation by their effects on single points<br />

• In practice these will be applied to multiple points to transfer entire scenes<br />

or objects made up of many defining points<br />

T<br />

Điểm gốc - Pivotal points<br />

Cho phép quay và tỉ lệ Rotation and Scaling<br />

• The simple versions of rotation and scaling have been based around the origin.<br />

• This means that when we rotate or scale, the object will also move, with<br />

respect to the origin<br />

• Translate all points through (-c1,-c2)<br />

• Rotate all points about the origin by<br />

• Translate all points back through (c1,c2)<br />

(c 1 ,c 2 )<br />

(c) SE/FIT/HUT 2002 19<br />

(0,0)<br />

(c) SE/FIT/HUT 2002<br />

Pivotal points<br />

• Often we wish to rotate or scale with respect to some pivotal<br />

point, not the origin<br />

• Most significantly, we often wish to rotate or scale an object<br />

about its centre, or midpoint<br />

• In this way, the object’s location does not change<br />

• To do this, we relate the rotation or scaling about the pivotal<br />

point V, to an elementary rotation or scaling about the origin<br />

• We first translate all points so that V coincides with the origin<br />

• We then rotate or about the origin<br />

• then all points are translated back, so that V is restored to its original<br />

location<br />

Hệ toạ độ đồng nhất<br />

• Vấn đề gặp phải:<br />

• An affine transformation is composed of a linear transformation<br />

followed by a translation<br />

• Unfortunately, the translation portion is not a matrix<br />

multiplication but must instead be added as an extra term, or<br />

vector<br />

• What we need is a “trick”, so that translations can be represented<br />

in matrix multiplication form<br />

• This then means that they can be easily composed with other<br />

transformations, by simply multiplying the matrices together<br />

(c) SE/FIT/HUT 2002<br />

(c) SE/FIT/HUT 2002<br />

Tọa độ đồng nhất<br />

Homogeneous Transform<br />

• x' = ax + by + n<br />

• y' = bx + dy + m<br />

• Phương pháp biểu diễn mở rộng thông qua tọa độ đồng<br />

nhất của các vector vị trí<br />

• Với ứng dụng của phép chiếu hìnhhọc màởđótọa độ<br />

điểm được môtả dưới ma trận [ x* y* h]<br />

• với x = x*/h, y = y*/h, z = z*/h và h là mộtsố thựctuỳ ý<br />

Ưu điểmcủaHệ tọa độ đồng nhất<br />

Homogeneous Transform<br />

• Ðưaracáinhìnhợp nhấtcủa các phép biến đổidưới phép<br />

nhân ma trận, hỗ trợ cho việcxử lý bằng cả phần cứng và<br />

phần mềm<br />

• Kếthợp các các phép biến đổitạo thànhma trận tích đơn giản<br />

duy nhất. Tránh nhầmlẫn về thứ tự của các phép nhân khi sử<br />

dụng.<br />

• Order matters: AB is generally not the same as BA<br />

• Chophépkếthợp vớicả các phép biến đổi đặcbiệt không<br />

tuyến tính khác(non-affine) như:<br />

• Phép chiếu phối cảnh - Perspective projections!<br />

• Uốn - Bends, Vuốt tapers v.v.v<br />

(c) SE/FIT/HUT2002 23<br />

(c) SE/FIT/HUT 2002 24<br />

4


Khoa CNTT - DDHBK Hà nội<br />

hunglt@it-hut.edu.vn<br />

8682595<br />

Phép biến đổi vớitọa độ đồng nhất<br />

Phép tỉ lệ<br />

• Ma trận biến đổi đồng nhất ⎡a<br />

b 0⎤<br />

[ T ] =<br />

⎢<br />

⎢<br />

c d 0<br />

• Phép tịnh tiến<br />

⎢ ⎥ ⎥⎥ ⎣m<br />

n 1⎦<br />

⎡ 1 0 0⎤<br />

[ x ' y'<br />

1] = [ x y 1]<br />

⎢<br />

⎢<br />

0 1 0<br />

⎥<br />

⎥<br />

= [ x + m y + n<br />

⎢⎣<br />

m n 1⎥⎦<br />

1]<br />

⎡S1<br />

0 0⎤<br />

[ x ' y'<br />

1] = [ x y 1]<br />

⎢<br />

0<br />

⎢<br />

S2<br />

0<br />

⎥<br />

= [ x.<br />

S1<br />

⎥<br />

y.<br />

S2<br />

⎢⎣<br />

0 0 1⎥⎦<br />

1]<br />

(t x , t y , t z )<br />

(c) SE/FIT/HUT 2002 25<br />

(c) SE/FIT/HUT 2002 26<br />

Phép quay<br />

Phép biến đổi tổng hợp<br />

[ x'<br />

y'<br />

1] = [ x y 1]<br />

⎡ cos φ<br />

⎢<br />

− sin φ<br />

⎢<br />

sin φ<br />

cos φ<br />

⎢⎣<br />

0 0<br />

0⎤<br />

0<br />

⎥<br />

⎥<br />

1⎥⎦<br />

= [ x .cosφ<br />

− y.sinφ<br />

x.sinφ<br />

+ y.cosφ<br />

1]<br />

y<br />

( x’, y’ )<br />

ρ<br />

θ<br />

α<br />

ρ<br />

( x, y )<br />

x<br />

(c) SE/FIT/HUT 2002 27<br />

(c) SE/FIT/HUT 2002 28<br />

Coordinate Transforms<br />

Coordinate Transforms<br />

u<br />

x<br />

(1,1)<br />

u’<br />

(1,1)<br />

(c) SE/FIT/HUT 2002<br />

Object defined in Local<br />

Coordinate System<br />

v<br />

v’<br />

y<br />

Object after transformation in<br />

Global Coordinate System<br />

(c) SE/FIT/HUT 2002 30<br />

5


Khoa CNTT - DDHBK Hà nội<br />

hunglt@it-hut.edu.vn<br />

8682595<br />

Identity as a Coordinate Transform<br />

Translation<br />

x<br />

u<br />

(1,1)<br />

x<br />

u’<br />

(1,1)<br />

x<br />

u<br />

(1,1)<br />

⎡1<br />

0 tx⎤<br />

Q =<br />

⎢<br />

0 1<br />

⎥<br />

⎢<br />

ty<br />

⎥<br />

P<br />

⎢⎣<br />

0 0 1 ⎥⎦<br />

x<br />

u’<br />

(1+tx,1+ty)<br />

⎡1<br />

Q =<br />

⎢<br />

⎢<br />

0<br />

⎢⎣<br />

0<br />

0<br />

1<br />

0<br />

v<br />

0⎤<br />

0<br />

⎥<br />

⎥<br />

P<br />

1⎥⎦<br />

y<br />

v’ y<br />

(c) SE/FIT/HUT 2002 31<br />

⎡1<br />

⎢<br />

⎢<br />

0<br />

⎢⎣<br />

0<br />

0 tx⎤⎡0⎤<br />

⎡tx⎤<br />

1 ty<br />

⎥⎢<br />

⎥<br />

=<br />

⎢ ⎥<br />

⎥⎢<br />

0<br />

⎥ ⎢<br />

ty<br />

⎥<br />

0 1 ⎥⎦<br />

⎢⎣<br />

1⎥⎦<br />

⎢⎣<br />

1 ⎥⎦<br />

v y<br />

⎡tx⎤<br />

⎢ ⎥<br />

⎢ ⎥<br />

⎢⎣<br />

1 ⎥⎦<br />

⎡1<br />

⎢<br />

⎢<br />

0<br />

⎢⎣<br />

0<br />

0 tx⎤⎡1⎤<br />

⎡ 1+<br />

tx⎤<br />

1 ty<br />

⎥⎢<br />

⎥<br />

=<br />

⎢ ⎥<br />

⎥⎢<br />

0<br />

⎥ ⎢<br />

ty<br />

⎥<br />

0 1 ⎥⎦<br />

⎢⎣<br />

1⎥⎦<br />

⎢⎣<br />

1 ⎥⎦<br />

⎡1<br />

⎢<br />

⎢<br />

0<br />

⎢⎣<br />

0<br />

v’<br />

y<br />

0 tx⎤⎡0⎤<br />

⎡ tx ⎤<br />

1 ty<br />

⎥⎢<br />

⎥<br />

=<br />

⎢ ⎥<br />

⎥⎢<br />

1<br />

⎥ ⎢<br />

1+<br />

ty<br />

⎥<br />

0 1 ⎥⎦<br />

⎢⎣<br />

1⎥⎦<br />

⎢⎣<br />

1 ⎥⎦<br />

origin<br />

O = ty<br />

v (1, 0, 0) u (0, 1, 0)<br />

(c) SE/FIT/HUT 2002 32<br />

Rotation<br />

x<br />

u<br />

(1,1)<br />

u’<br />

x<br />

⎡0⎤<br />

O =<br />

⎢ ⎥<br />

⎢<br />

0<br />

⎥<br />

⎢⎣<br />

1⎥⎦<br />

Scaling<br />

x<br />

u<br />

(1,1)<br />

x<br />

u<br />

(sx*1,sy*1)<br />

v’<br />

v<br />

⎡cosθ<br />

− sinθ<br />

Q =<br />

⎢<br />

⎢<br />

sinθ<br />

cosθ<br />

⎢⎣<br />

0 0<br />

y<br />

0⎤<br />

0<br />

⎥<br />

⎥<br />

P<br />

1⎥⎦<br />

y<br />

⎡cosθ<br />

⎤ ⎡− sinθ<br />

⎤<br />

v =<br />

⎢ ⎥<br />

⎢<br />

sinθ<br />

⎥<br />

u =<br />

⎢ ⎥<br />

⎢<br />

cosθ<br />

⎥<br />

⎢⎣<br />

1 ⎥⎦<br />

⎢⎣<br />

1 ⎥⎦<br />

(c) SE/FIT/HUT 2002 33<br />

⎡sx<br />

0<br />

Q =<br />

⎢<br />

⎢<br />

0 sy<br />

⎢⎣<br />

0 0<br />

v<br />

0⎤<br />

0<br />

⎥<br />

⎥<br />

P<br />

1⎥⎦<br />

y<br />

y v<br />

⎡0⎤<br />

⎡sx⎤<br />

⎡ 0 ⎤<br />

=<br />

⎢ ⎥<br />

⎢ ⎥<br />

O<br />

⎢<br />

0<br />

⎥<br />

v =<br />

⎢ ⎥ u =<br />

⎢<br />

sy<br />

⎢<br />

0<br />

⎥<br />

⎥<br />

⎢⎣<br />

1⎥<br />

⎢ ⎥<br />

⎦ ⎢ ⎥ ⎣ 1<br />

⎣ 1 ⎦<br />

⎦<br />

(c) SE/FIT/HUT 2002 34<br />

Composite <strong>Transformations</strong><br />

x<br />

u<br />

(1,1)<br />

v y<br />

x<br />

O =<br />

u’<br />

v<br />

’<br />

y<br />

v =<br />

⎡x1(1<br />

− cosθ<br />

) + y1<br />

sinθ<br />

⎤<br />

⎢<br />

⎥<br />

⎢<br />

y1(1<br />

− cosθ<br />

) − y1<br />

sinθ<br />

⎥<br />

⎢⎣<br />

1 ⎥⎦<br />

⎡cosθ<br />

+ x1(1<br />

−cosθ<br />

) + y1<br />

sinθ<br />

⎤<br />

⎢<br />

⎥<br />

⎢<br />

sinθ<br />

+ y1<br />

(1 −cosθ<br />

) − y1<br />

sinθ<br />

⎥<br />

⎢⎣<br />

1 ⎥⎦<br />

Modeling <strong>Transformations</strong><br />

• To make full use of the computational optimisation made<br />

possible by composite transforms, we only want to apply the<br />

transformations to points at the very end<br />

• i.e. the transformation operation (multiplying point p by<br />

transform matrix is the very last thing we do in the modelling<br />

phase)<br />

⎛cosθ<br />

− sinθ<br />

⎜<br />

M = ⎜ sinθ<br />

cosθ<br />

⎜<br />

⎝ 0 0<br />

x1<br />

(1 − cosθ<br />

) + y1<br />

sinθ<br />

⎞<br />

⎟<br />

y1(1<br />

− cosθ<br />

) − x1<br />

sinθ<br />

⎟<br />

1 ⎟<br />

⎠<br />

u =<br />

⎡−sinθ<br />

+ x1<br />

(1 −cosθ<br />

) + y1<br />

sinθ<br />

⎤<br />

⎢<br />

⎥<br />

⎢<br />

cosθ<br />

+ y1<br />

(1 −cosθ<br />

) − y1<br />

sinθ<br />

⎥<br />

⎢⎣<br />

1<br />

⎥⎦<br />

Specify points<br />

in local coords<br />

Specify<br />

<strong>Transformations</strong><br />

(composite if necessary)<br />

Send to<br />

Pipeline<br />

(c) SE/FIT/HUT 2002 35<br />

(c) SE/FIT/HUT 2002 36<br />

6


Khoa CNTT - DDHBK Hà nội<br />

hunglt@it-hut.edu.vn<br />

8682595<br />

+<br />

+<br />

+<br />

+<br />

transform<br />

+<br />

transform<br />

+<br />

transform<br />

This of course shouldn’t<br />

mean all objects need to<br />

share the same<br />

transformations<br />

=<br />

Obviously we want<br />

something more<br />

versatile<br />

=<br />

(c) SE/FIT/HUT 2002 37<br />

(c) SE/FIT/HUT 2002 38<br />

7

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!