240 likes | 341 Vues
Learn how to reshape a square and create interactive animations through rotating vertices on a circle. Experiment with key events and color changes for an engaging experience.
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