240 likes | 333 Views
Interaction and Animation. 고려대학교 컴퓨터 그래픽스 연구실. 2D Polygon. Reshape. Result – Reshape. Animation – Rotating a Square. Four Vertices of the Square to Lie at Four Equally Spaced Points on a Circle. (-sin θ , cos θ ). (cos θ , sin θ ). (-cos θ , -sin θ ). (sin θ , -cos θ ). Class Wizard.
E N D
Interaction and Animation 고려대학교 컴퓨터 그래픽스 연구실 kucg.korea.ac.kr
2D Polygon kucg.korea.ac.kr
Reshape kucg.korea.ac.kr
Result – Reshape kucg.korea.ac.kr
Animation – Rotating a Square • Four Vertices of the Square to Lie at Four Equally Spaced Points on a Circle (-sinθ, cosθ) (cosθ, sinθ) (-cosθ, -sinθ) (sinθ, -cosθ) kucg.korea.ac.kr
Class Wizard kucg.korea.ac.kr
New Variables kucg.korea.ac.kr
Constructor kucg.korea.ac.kr
OnCreate( ) kucg.korea.ac.kr
OnSize( ) kucg.korea.ac.kr
DrawScene( ) kucg.korea.ac.kr
Math Header File kucg.korea.ac.kr
OnTimer( ) kucg.korea.ac.kr
Result – Rotating a Square kucg.korea.ac.kr
Double Buffering (1/2) kucg.korea.ac.kr
Double Buffering (2/2) kucg.korea.ac.kr
Interaction by the Keyboard kucg.korea.ac.kr
Key Event Handling kucg.korea.ac.kr
Interaction by the Menu kucg.korea.ac.kr
Resources – Menu (1/2) kucg.korea.ac.kr
Resources – Menu (2/2) kucg.korea.ac.kr
Class Wizard kucg.korea.ac.kr
Callback Function kucg.korea.ac.kr
Exercises • Rotate a square in the reverse direction if ‘R’ or ‘r’ is pressed • Change the color of square randomly whenever the left mouse button is clicked kucg.korea.ac.kr