-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMesh.h
50 lines (37 loc) · 958 Bytes
/
Mesh.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
/*======================================================*\
Wednesday September the 25th 2013
Arash HABIBI
Mesh.h
\*======================================================*/
#ifndef _MESH_H_
#define _MESH_H_
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <GL/glut.h>
#include <GL/glx.h>
#include "Vector.h"
#include "Polygon.h"
#include "Perlin.h"
#define M_MAX_QUADS 5000
typedef struct
{
Vector _vertices[4];
} Quad;
Quad Q_new(Vector v1, Vector v2, Vector v3, Vector v4);
//--------------------------------------------
typedef struct
{
int _nb_quads;
Quad _quads[M_MAX_QUADS];
int _is_filled;
// int _is_smooth;
} Mesh;
Mesh* M_new();
void M_print(Mesh *P, char *message);
void M_addQuad(Mesh *P, Quad q);
void M_addSlice(Mesh *P, Polygon *p1, Polygon *p2);
void M_revolution(Mesh *P, Polygon *p1, int nb_slices);
void M_perlinExtrude(Mesh *QM, Polygon *p, int nb_slices);
void M_draw(Mesh *P);
#endif // _MESH_H_