[그래픽스] 2D 애니메이션 (니모를 찾는 니모 아빠와 도리)
#include "cg.h" #include "draw.h" int w = 1000; int h = 1000; float t = 0.0; void display() { glClear(GL_COLOR_BUFFER_BIT); glClearColor(0.2, 0.2, 1.0, 1.0); // center glColor3f(0.2, 0.2, 1.0); rect(vector2D(-0.1, 0.1), vector2D(0.1, -0.1)); // Nemo's body glPushMatrix(); glRotatef(20.0 * t, 0.0, 0.0, 1.0); glTranslatef(0.0, 0.5 + 0.05 * sin(4 * t), 0.0); glColor3f(1.0, 0.6, 0.0); ellipse(vector..
2022. 2. 9.