-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathModel.h
More file actions
37 lines (35 loc) · 681 Bytes
/
Model.h
File metadata and controls
37 lines (35 loc) · 681 Bytes
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
#pragma once
#include "Vec3.h"
#include <vector>
#include "VertexIndexBuf.h"
#include "Vertex.h"
#include "OBJLoader.h"
class Model
{
private:
std::vector<Vec3f> vertices;
std::vector<Vec3f> normals;
//std::vector<size_t> indices;
public:
Model()
{
std::vector<Vertex> model;
model = loadOBJ("OBJFiles/untitled.obj");
for (size_t i = 0;
i < model.size(); i++)
{
vertices.emplace_back(model[i].pos);
normals.emplace_back(model[i].normal);
}
}
VertexIndexBuf GetTriangle() const
{
/*return{ //for wire framed
vertices,{
0,1, 1,3, 3,2, 2,0,
0,4, 1,5, 3,7, 2,6,
4,5, 5,7, 7,6, 6,4 }
};*/
return{ vertices, normals };
}
};