written 7.2 years ago by | • modified 7.1 years ago |
Mumbai University > Computer Engineering > Sem 4 > Computer Graphics
Marks: 5 Marks
Year: May 2016
written 7.2 years ago by | • modified 7.1 years ago |
Mumbai University > Computer Engineering > Sem 4 > Computer Graphics
Marks: 5 Marks
Year: May 2016
written 7.2 years ago by |
Rotation:
To rotate an object about the origin (0,0), we specify the rotation angle ?. Positive and negative values for the rotation angle define counterclockwise and clockwise rotations respectively. The followings is the computation of this rotation for a point:
x' = x cos ? - y sin ?
y' = x sin ? + y cos ?
Alternatively, this rotation can also be specified by the following transformation matrix:
$\begin{bmatrix} \ cos \theta & -sin \theta & 0 \\ \ sin \theta & cos \theta & 0 \\ \ 0 & 0 & 1 \\ \end{bmatrix}$
Then we can rewrite the formula as:
$\begin{bmatrix} \ x' \\ \ y' \\ \ 1 \\ \end{bmatrix}=$ $\begin{bmatrix} \ cos \theta & -sin \theta & 0 \\ \ sin \theta & cos \theta & 0 \\ \ 0 & 0 & 1 \\ \end{bmatrix}$ $\begin{bmatrix} \ x \\ \ y \\ \ 1 \\ \end{bmatrix}$
P’= R(θ) .P
By multiplying two rotation matrices ,we can verify that two successive rotations are additive: