Prepared by ononiwu ugochukwu overview of computer graphics



Download 78.8 Kb.
Page23/29
Date22.06.2021
Size78.8 Kb.
#56924
1   ...   19   20   21   22   23   24   25   26   ...   29
COM 422 - Computer Graphics & Animation


  1. Rotation


It is a process of rotating an object at particular angle θ theta from its origin. Rotation can be clockwise or anticlockwise. To perform rotation, we need to specify the rotation angle and the position of the rotation point. The rotation point is also called a pivot point. We first find the equation of rotation when pivot point is at coordinate origin (0, 0).

From the above figure P(x, y) can be represented as:



x = rcosϕ

y = rsinϕ

Similarly, we can represent the point P'(x’, y’) as:



x’ = rcos (ϕ+θ) = rcosϕcosθ – rsinϕ sinθ

y’ = rsin (ϕ+θ) = rcosϕsinθ + rsinϕcosθ

Now replace 𝒓 𝐜𝐨𝐬 ∅ with 𝒙 and 𝒓 𝐬𝐢𝐧 ∅ with 𝒚 in above equation



x’ = xcosθ – ysinθ

y’ = xsinθ + ycosθ

Download 78.8 Kb.

Share with your friends:
1   ...   19   20   21   22   23   24   25   26   ...   29




The database is protected by copyright ©ininet.org 2024
send message

    Main page