-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpchoron.cpp
More file actions
57 lines (46 loc) · 1.19 KB
/
pchoron.cpp
File metadata and controls
57 lines (46 loc) · 1.19 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
#include "include/four.h"
vec5 pcVerts[5] = {
vec5(0.0f, 0.5f, 0.0f, 0.0f, 1.0f), //0
vec5(-0.5f, 0.0f, 0.0f, 0.0f, 1.0f), //1
vec5(0.5f, 0.0f, 0.0f, 0.0f, 1.0f), //2
vec5(0.0f, 0.0f, -0.5f, 0.0f, 1.0f), //3
vec5(0.0f, 0.0f, 0.0f, -0.5f, 1.0f) //4
};
unsigned int pcInds[30] = {
0, 1, 2,
3, 1, 2,
3, 0, 1,
3, 0, 2,
4, 0, 1,
4, 0, 2,
4, 0, 3,
4, 1, 2,
4, 1, 3,
4, 2, 3
};
int main(int argc, char *argv[]){
Window w;
w.create();
//use GL_LINE_STRIP instead of GL_LINES
w.setUseLineStrip(true);
Camera c;
c.create();
w.setActiveCamera(&c);
Object pc;
pc.create(pcVerts, 5, pcInds, 30);
pc.setUniformColor(glm::vec4(0.0f, 1.0f, 1.0f, 1.0f));
w.addToScene(&pc);
w.setRenderMode(Window::RENDER_WIREFRAME);
//w.set4DProjection(Window::PROJECT_PERSPECTIVE);
pc.scale(4.0f);
while(!w.shouldClose()){
w.clear(0.1f, 0.2f, 0.3f);
pc.rotate(Object::YW_PLANE, 0.01f);
//pc.rotate(Object::XW_PLANE, 0.01f);
//pc.rotate(Object::ZW_PLANE, 0.02f);
w.update();
if(w.getKeyPress(SDL_SCANCODE_ESCAPE)){
w.setShouldClose(true);
}
}
}