-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmeshfactory.h
47 lines (37 loc) · 1.17 KB
/
meshfactory.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
//-------------------------------------------------------
// Filename: meshfactory.h
//
// Description: A factory for creating triangle surface meshes
// for a cube, cone and ellipse
//
// Creator: Professor Corey McBride for MEEN 570 - Brigham Young University
//
// Creation Date: 10/10/16
//
// Owner: Corey McBride
//-------------------------------------------------------
#ifndef MESHFACTORY_H
#define MESHFACTORY_H
#include <map>
#include <QGLWidget>
#include <QOpenGLFunctions>
#include <QVector3D>
class MeshGeometry3D
{
public:
std::vector<GLfloat> mVerticies;
std::vector<GLfloat> mNormals;
std::vector<GLuint> mIndicies;
GLfloat Color[3];
void apply_transform(QMatrix4x4& transform);
};
class MeshFactory
{
public:
MeshFactory();
void GenerateEllipsoidMesh(double rx, double ry, double rz, int refinement_level, MeshGeometry3D *geometry);
void GenerateCubeMesh(int width, int height, int depth, int refinement_level, MeshGeometry3D *geometry);
void GenerateConeMesh(double rx, double ry, double height, int divisions, MeshGeometry3D *geometry);
private:
};
#endif // MESHFACTORY_H