-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvector.h
More file actions
45 lines (35 loc) · 909 Bytes
/
Copy pathvector.h
File metadata and controls
45 lines (35 loc) · 909 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
38
39
40
41
42
43
44
45
#ifndef _VECTOR_H_
#define _VECTOR_H_
#endif
#ifdef PATI
#define GLEW_STATIC
#endif
#ifdef ANDI
#define _USE_MATH_DEFINES
#endif
/* Standard includes */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
/* OpenGL includes */
#include <GL/glew.h>
#include <GL/freeglut.h>
/* Local includes */
#include "LoadShader.h"
#include "Matrix.h"
#include "OBJParser.h" /* Loading function for triangle meshes in OBJ format */
struct vec3 {
GLfloat x;
GLfloat y;
GLfloat z;
};
struct vec3 vec3(GLfloat* v);
GLfloat dot3(struct vec3 v1, struct vec3 v2);
GLfloat len3(struct vec3 v);
struct vec3 normalize3(struct vec3 v);
struct vec3 add(struct vec3 v1, struct vec3 v2);
GLfloat det3x3(GLfloat* x, GLfloat* y, GLfloat* z);
void calculateNormals(GLushort* ida, GLfloat* vba, GLfloat* nba, int ndxs, int vdxs);
GLfloat norm3(GLfloat* vec);
void normailize(GLfloat* nba, int len);