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
'College Computer Science > Computer Graphics' 카테고리의 다른 글
[컴퓨터그래픽스] 키보드 마우스 입력을 통한 화면 변경 (0) | 2021.04.03 |
---|---|
[컴퓨터그래픽스] openGL 사용하지 않고 culling 수행하기 (0) | 2021.04.03 |
[컴퓨터그래픽스] gluLookat 변경을 통한 애니메이션 만들기 (0) | 2021.04.03 |
[컴퓨터그래픽스] transformation, scale, rotation (0) | 2021.04.03 |
[컴퓨터그래픽스] 세가지 방법으로 오각형 그리기, OpenGL에서 primitive 그리기, glVertex, glDrawArrays, glDrawElements (0) | 2020.05.22 |
댓글