-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGraphObject.h
76 lines (55 loc) · 1.17 KB
/
GraphObject.h
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
#ifndef GRAPHOBJECT_H
#define GRAPHOBJECT_H
#include <string>
#include <vector>
#include <map>
#include <iostream>
#include <GL/glew.h>
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtx/transform.hpp>
struct Kolor
{
float r, g, b;
Kolor() : r(1.0), g(1.0), b(1.0)
{ }
Kolor(float r, float g, float b)
{
this->r = r;
this->g = g;
this->b = b;
}
};
struct Vertex
{
float x, y, z;
Kolor kolor;
float nx, ny, nz;
};
struct Triangle
{
int a, b, c;
int normalna;
Kolor kolor;
};
struct Model
{
std::map<int, Vertex > wierzcholki;
std::map<int, glm::vec3 > normalne;
std::vector<Triangle > trojkaty;
std::string nazwa;
std::string material;
int retVertCount();
int retBufVert(Vertex * bufor);
int retElemCount();
int retBufElem(GLint * bufor);
int bufCount;
int retBufCount();
int retBuf(Vertex * bufor);
std::vector<Vertex > Vertices;
int retBufVerticesOnly(Vertex * bufor);
Kolor kolor;
void ustawKolorAllVert(Kolor kolor);
glm::vec3 wyznaczVertNormal(int abc, Vertex & vert_buf);
void wyznaczAllVertNormal();
};
#endif // GRAPHOBJECT_H