-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathquestion2.cpp
More file actions
103 lines (103 loc) · 2.47 KB
/
question2.cpp
File metadata and controls
103 lines (103 loc) · 2.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
//
//#include "Header.h"
//
//int Width, Height;
//
//void Init() {
// glClearColor(1.0, 1.0, 1.0, 1.0);
// glMatrixMode(GL_PROJECTION);
//
// glLoadIdentity();
// glOrtho(-2.0, 2.0, -2.0, 2.0, 0.5, 5.0);
// glMatrixMode(GL_MODELVIEW);
// glLoadIdentity();
//}
//
//void Draw_Scene() {
// glColor3f(0.7, 0.7, 0.7);
// glPushMatrix();
// glTranslatef(0.0, -1.0, 0.0);
// glBegin(GL_QUADS);
// glVertex3f(2.0, 0.0, 2.0);
// glVertex3f(2.0, 0.0, -2.0);
// glVertex3f(-2.0, 0.0, -2.0);
// glVertex3f(-2.0, 0.0, 2.0);
// glEnd();
// glPopMatrix();
//
// glColor3f(0.3, 0.3, 0.7);
// glPushMatrix();
// glTranslatef(0.0, 0.0, -0.5);
// glutWireTeapot(1.0);
// glPopMatrix();
//
// glColor3f(0.0, 1.0, 1.0);
// glPushMatrix();
// glTranslatef(0, 0, 1);
// glutSolidCube(1.0);
// glPopMatrix();
//
// glColor3f(1, 0, 0);
// glBegin(GL_LINE);
// glVertex3f(0, 0, 0);
// glVertex3f(5, 0, 0);
// glEnd();
//
//}
//
//void MyDisplay() {
// glClear(GL_COLOR_BUFFER_BIT); // 배경색으로 화면을 지운다.
// glColor3f(1.0, 1.0, 1.0);
// glViewport(0, 0, Width / 2, Height / 2);
//
// glPushMatrix();
// gluLookAt(0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0);
// Draw_Scene();
// glPopMatrix();
//
// glViewport(Width / 2, 0, Width / 2, Height / 2);
//
// glPushMatrix();
// gluLookAt(1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0);
// Draw_Scene();
// glPopMatrix();
//
// glViewport(0, Height / 2, Width / 2, Height / 2);
//
// glPushMatrix();
// gluLookAt(0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -1.0);
// Draw_Scene();
// glPopMatrix();
//
// glViewport(Width / 2, Height / 2, Width / 2, Height / 2);
// glMatrixMode(GL_PROJECTION);
// glPushMatrix();
// glLoadIdentity();
// gluPerspective(30, 1.0, 3.0, 50.0);
// glMatrixMode(GL_MODELVIEW);
// glPushMatrix();
// gluLookAt(5.0, 5.0, 5.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0);
// Draw_Scene();
// glPopMatrix();
//
// glMatrixMode(GL_PROJECTION);
// glPopMatrix();
// glFlush();
//}
//
//void MyReshape(int w, int h) {
// Width = w; Height = h;
//}
//
//int main(int argc, char** argv) {
// Width = 500; Height = 500;
// glutInitDisplayMode(GLUT_SINGLE | GLUT_RGBA);
// glutInitWindowSize(Width, Height);
// glutInitWindowPosition(0, 0);
// glutCreateWindow("OPEN GL");
// Init();
// glutDisplayFunc(MyDisplay);
// glutReshapeFunc(MyReshape);
// glutMainLoop();
// return 0;
//}