-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMatrix.hpp
More file actions
27 lines (22 loc) · 711 Bytes
/
Matrix.hpp
File metadata and controls
27 lines (22 loc) · 711 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
/**
* File: Matrix.hpp
* Description: header of Matrix class
*/
#ifndef CMATRIX_H
#define CMATRIX_H
#include <iostream>
#include <GL/gl.h>
#include <math.h>
using namespace std;
class Matrix {
public:
GLfloat mat[4][4]; // this matrix is for MC
Matrix(); // constructor
void matrix_pre_multiply(Matrix* m); // m*mat
void transpose(); // mat'
void translate(GLfloat x, GLfloat y, GLfloat z); // translate MC = T(x, y, z)
void rotate(GLfloat x, GLfloat y, GLfloat z, GLfloat angle); //rotate w.r.p.t. vector (x, y, z) by angle
void multiply_vector(GLfloat* v); // mat*v
void normalize(); // this function is to normalize MC
};
#endif