College Computer Science/Computer Graphics
[컴퓨터그래픽스] 소용돌이 실습 (함수 사용하지 않기)
2den
2021. 4. 3. 17:23
728x90
void RenderScene(void)
{
glClear(GL_COLOR_BUFFER_BIT);
glMatrixMode(GL_MODELVIEW);
GLfloat rotation[16] = {
cos(30.0), 0, -sin(30.0), 0,
0, 1, 0, 0,
sin(30.0), 0, cos(30.0), 0,
0, 0, 0, 1
};
GLfloat translation[16] = {
1, 0, 0, 0,
0, 1, 0, 0,
0, 0, 1, 0,
0, -0.1, 0, 1
};
glPushMatrix();
glColor3f(0.5f, 0.5f, 0.5f);
glPointSize(3);
glBegin(GL_POINTS);
glVertex4f(0.25f, 0.8f, 0.0f, 1.0f);
glEnd();
for (int i = 0; i < 35; i++) {
glMultMatrixf(translation);
glMultMatrixf(rotation);
glBegin(GL_POINTS);
glVertex4f(0.25f, 0.8f, 0.0f, 1.0f);
glEnd();
}
glPopMatrix();
glFlush();
}
728x90