-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTriangle.cpp
32 lines (28 loc) · 1.08 KB
/
Triangle.cpp
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
#include "triangle.hpp"
VertexArray::TypeVertices Triangle::getVertices() const {
VertexArray::TypeVertices vertices = {
{ 0.5f, 0.5f, 0.5f, 0.0f, 0.0f, 1.0f, 1.000000f, 1.000000f },
{ -0.5f, 0.5f, 0.5f, 0.0f, 0.0f, 1.0f, 1.000000f, 0.000000f },
{ -0.5f, 0.5f, -0.5f, 0.0f, 0.0f, 1.0f, 1.000000f, 1.000000f },
{ 0.5f, 0.5f, -0.5f, 0.0f, 0.0f, 1.0f, 1.000000f, 0.000000f },
{ 0.5f, -0.5f, 0.5f, 0.0f, 0.0f, 1.0f, 1.000000f, 1.000000f },
{ -0.5f, -0.5f, 0.5f, 0.0f, 0.0f, 1.0f, 1.000000f, 0.000000f },
{ -0.5f, -0.5f, -0.5f, 0.0f, 0.0f, 1.0f, 1.000000f, 1.000000f },
{ 0.5f, -0.5f, -0.5f, 0.0f, 0.0f, 1.0f, 1.000000f, 0.000000f },
};
return vertices;
}
Transformation Triangle::getTransformation() const {
return glm::rotate(glm::mat4({
{ 1.0f, 0.0f, 0.0f, 0.0f },
{ 0.0f, 1.0f, 0.0f, 0.0f },
{ 0.0f, 0.0f, 1.0f, 0.0f },
{ 0.0f, 0.0f, 0.0f, 1.0f },
}), 1.0f, glm::vec3(1, 0, 0));
}
VertexArray::TypeIndices Triangle::getIndices() const {
return VertexArray::TypeIndices({
{ 0, 1, 2 }
});
}
void Triangle::bindRenderingResources() const { }