Browse Source

Catmullromsplies hinzugefügt

Camera hinzugefügt
Bugfixes
seba 11 years ago
parent
commit
026961a7a6
14 changed files with 453 additions and 46 deletions
  1. 2
    2
      Makefile
  2. 101
    0
      catmullromspline.cpp
  3. 31
    0
      catmullromspline.h
  4. 6
    0
      emath_opengl.cpp
  5. 154
    0
      glcamera.cpp
  6. 56
    0
      glcamera.h
  7. 4
    0
      glcolor.cpp
  8. 1
    0
      glcolor.h
  9. 1
    0
      glmenu/menumenu.cpp
  10. 47
    40
      matrix.cpp
  11. 5
    4
      matrix.h
  12. 34
    0
      punkt3d.cpp
  13. 10
    0
      punkt3d.h
  14. 1
    0
      rotationsmatrix.cpp

+ 2
- 2
Makefile View File

@@ -1,6 +1,6 @@
1 1
 CC = g++
2 2
 AR = ar
3
-OBJECTS = punkt3d.o punkt2d.o emath.o emath_opengl.o glcolor.o gldrawhelper.o glfontengine.o glrect.o gltexture.o matrix.o quaternion.o rotationsmatrix.o glsdlscreen.o sdlfuncs.o fpsmanager.o
3
+OBJECTS = punkt3d.o punkt2d.o emath.o emath_opengl.o glcolor.o gldrawhelper.o glfontengine.o glrect.o gltexture.o matrix.o quaternion.o rotationsmatrix.o glsdlscreen.o sdlfuncs.o fpsmanager.o glcamera.o catmullromspline.o
4 4
 OBJOPT = -Wall -c `sdl-config --cflags`
5 5
 SUBDIRS = glgui glmenu models
6 6
 SUBDIROBJECTS = glgui/*.o glmenu/*.o models/*.o
@@ -37,4 +37,4 @@ clean: cleansubdirs
37 37
 	rm -f $(OBJECTS)
38 38
 # 	cd glgui; $(MAKE) clean
39 39
 # 	cd glmenu; $(MAKE) clean
40
-	@echo Done cleaning...
40
+	@echo Done cleaning...

+ 101
- 0
catmullromspline.cpp View File

@@ -0,0 +1,101 @@
1
+#include "catmullromspline.h"
2
+
3
+CatmullRomSpline::CatmullRomSpline(float _s) {
4
+	cr = new Matrix(4, 4);
5
+	setS(_s);
6
+}
7
+
8
+void CatmullRomSpline::makeMatrix() {
9
+	cr->set(-s	, 0, 0);
10
+	cr->set( 2-s	, 0, 1);
11
+	cr->set( s-2	, 0, 2);
12
+	cr->set( s	, 0, 3);
13
+	
14
+	cr->set( 2*s	 , 1, 0);
15
+	cr->set( s-3  , 1, 1);
16
+	cr->set( 3-2*s, 1, 2);
17
+	cr->set(-s    , 1, 3);
18
+
19
+	cr->set(-s, 2, 0);
20
+	cr->set( 0, 2, 1);
21
+	cr->set( s, 2, 2);
22
+	cr->set( 0, 2, 3);
23
+
24
+	cr->set( 0, 3, 0);
25
+	cr->set( 1, 3, 1);
26
+	cr->set( 0, 3, 2);
27
+	cr->set( 0, 3, 3);
28
+}
29
+
30
+Matrix CatmullRomSpline::getPosition(float u, Matrix &controlpoints) {
31
+// 	Matrix controlpoints(4, a.getN());
32
+// 	for(int i=0; i<a.getN(); i++) {
33
+// 		controlpoints.set(a.get(0, i), 0, i);
34
+// 		controlpoints.set(b.get(0, i), 1, i);
35
+// 		controlpoints.set(c.get(0, i), 2, i);
36
+// 		controlpoints.set(d.get(0, i), 3, i);
37
+// 	}
38
+	Matrix param(1, 4);
39
+	param.set(u*u*u, 0, 0);
40
+	param.set(u*u,   0, 1);
41
+	param.set(u,     0, 2);
42
+	param.set(1,     0, 3);
43
+	
44
+	return param * (*cr) * controlpoints;
45
+}
46
+
47
+Punkt3D CatmullRomSpline::getPosition(float u, Punkt3D a, Punkt3D b, Punkt3D c, Punkt3D d) {
48
+	Matrix erg(1, 3);
49
+	Matrix controlpoints(4, 3);
50
+	
51
+	controlpoints.set(a.x, 0, 0);
52
+	controlpoints.set(a.y, 0, 1);
53
+	controlpoints.set(a.z, 0, 2);
54
+	
55
+	controlpoints.set(b.x, 1, 0);
56
+	controlpoints.set(b.y, 1, 1);
57
+	controlpoints.set(b.z, 1, 2);
58
+	
59
+	controlpoints.set(c.x, 2, 0);
60
+	controlpoints.set(c.y, 2, 1);
61
+	controlpoints.set(c.z, 2, 2);
62
+	
63
+	controlpoints.set(d.x, 3, 0);
64
+	controlpoints.set(d.y, 3, 1);
65
+	controlpoints.set(d.z, 3, 2);
66
+	
67
+	erg = getPosition(u, controlpoints);
68
+	
69
+	return Punkt3D(erg.get(0,0), erg.get(0,1), erg.get(0,2));
70
+}
71
+
72
+Punkt2D CatmullRomSpline::getPosition(float u, Punkt2D a, Punkt2D b, Punkt2D c, Punkt2D d) {
73
+	Matrix erg(1, 2);
74
+	Matrix controlpoints(4, 2);
75
+	
76
+	controlpoints.set(a.x, 0, 0);
77
+	controlpoints.set(a.y, 0, 1);
78
+	
79
+	controlpoints.set(b.x, 1, 0);
80
+	controlpoints.set(b.y, 1, 1);
81
+	
82
+	controlpoints.set(c.x, 2, 0);
83
+	controlpoints.set(c.y, 2, 1);
84
+	
85
+	controlpoints.set(d.x, 3, 0);
86
+	controlpoints.set(d.y, 3, 1);
87
+	
88
+	erg = getPosition(u, controlpoints);
89
+	
90
+	return Punkt2D(erg.get(0,0), erg.get(0,1));
91
+}
92
+
93
+
94
+void CatmullRomSpline::setS(float _s) {
95
+	s = _s;
96
+	makeMatrix();
97
+}
98
+
99
+CatmullRomSpline::~CatmullRomSpline() {
100
+	delete(cr);
101
+}

+ 31
- 0
catmullromspline.h View File

@@ -0,0 +1,31 @@
1
+#ifndef __CATMULLROMSPLINE_H
2
+#define __CATMULLROMSPLINE_H
3
+
4
+#include <iostream>
5
+#include <SDL.h>
6
+#include <SDL_opengl.h>
7
+#include "matrix.h"
8
+#include "punkt2d.h"
9
+#include "punkt3d.h"
10
+
11
+
12
+class CatmullRomSpline {
13
+	private:
14
+		Matrix *cr;
15
+		float s;
16
+		
17
+		void makeMatrix();
18
+	public:
19
+		CatmullRomSpline(float _s=0.5f);
20
+		
21
+		Matrix getPosition(float u, Matrix &controlpoints);
22
+		Punkt3D getPosition(float u, Punkt3D a, Punkt3D b, Punkt3D c, Punkt3D d);
23
+		Punkt2D getPosition(float u, Punkt2D a, Punkt2D b, Punkt2D c, Punkt2D d);
24
+		
25
+		
26
+		void setS(float _s);
27
+		~CatmullRomSpline();
28
+};
29
+
30
+
31
+#endif

+ 6
- 0
emath_opengl.cpp View File

@@ -41,6 +41,12 @@ void rotFrom2VecTo2Vec(Punkt3D a, Punkt3D b, Punkt3D c, Punkt3D d) {
41 41
 	Punkt3D rvec, rvec2;
42 42
 	float rvecdeg, rvecdeg2;
43 43
 	rotFrom2VecTo2Vec(a, b, c, d, &rvec, &rvecdeg, &rvec2, &rvecdeg2);
44
+// 	if(rvecdeg)
44 45
 	glRotatef(rvecdeg, rvec);
46
+// 	if(rvecdeg2)
45 47
 	glRotatef(rvecdeg2, rvec2);
48
+// 	std::cout << rvecdeg << ", " << rvecdeg2 << std::endl;
49
+// 	rvec.print("rvecdeg");
50
+// 	rvec2.print("rvecdeg2");
51
+	
46 52
 }

+ 154
- 0
glcamera.cpp View File

@@ -0,0 +1,154 @@
1
+#include "glcamera.h"
2
+
3
+GLCamera::GLCamera() {
4
+	std_norm.set(0.0f, 1.0f, 0.0f);
5
+	std_dir.set(0.0f, 0.0f, -1.0f);
6
+	mpersec = 10.0f;
7
+	apersec = 90.0f;
8
+	doupdate = true;
9
+
10
+	norm.set(0.0f, 1.0f, 0.0f);
11
+	dir.set(0.0f, 0.0f, -1.0f);
12
+	
13
+	rotx = roty = 0.0f;
14
+	
15
+	rotmatX.set(x_axis, 0.0f);
16
+	rotmatY.set(y_axis, 0.0f);
17
+}
18
+
19
+void GLCamera::updateVectors() {
20
+	dir = rotmatY * rotmatX * Punkt3D(0.0f, 0.0f, -1.0f);
21
+	norm = rotmatY * rotmatX * std_norm;
22
+	dir.normalize();
23
+	norm.normalize();
24
+}
25
+
26
+void GLCamera::setCamera() {
27
+
28
+	if(doupdate) {
29
+		updateVectors();
30
+	}
31
+	Punkt3D port = pos + dir;
32
+	gluLookAt(	pos.x, 	pos.y,	pos.z,
33
+				port.x, port.y, port.z,
34
+				norm.x, norm.y, norm.z);
35
+// 	rotFrom2VecTo2Vec(std_dir, dir, std_norm, norm);
36
+// 	glTranslateP3D(-pos);
37
+}
38
+
39
+
40
+// Move-Funktionen
41
+
42
+void GLCamera::moveForward(float sec) {
43
+	if(doupdate) {
44
+		updateVectors();
45
+	}
46
+	pos += (mpersec*sec) * dir;
47
+// 	std::cout << "move..";
48
+// 	pos.print("pos");
49
+}
50
+
51
+void GLCamera::moveBackward(float sec) {
52
+	if(doupdate) {
53
+		updateVectors();
54
+	}
55
+	pos -= (mpersec*sec) * dir;
56
+}
57
+
58
+void GLCamera::moveLeft(float sec) {
59
+	if(doupdate) {
60
+		updateVectors();
61
+	}
62
+	Punkt3D right = (dir.kreuzprodukt(norm));
63
+	right.normalize();
64
+	pos -= right * sec * mpersec;
65
+
66
+}
67
+
68
+void GLCamera::moveRight(float sec) {
69
+	if(doupdate) {
70
+		updateVectors();
71
+	}
72
+	Punkt3D right = (dir.kreuzprodukt(norm));
73
+	right.normalize();
74
+	pos += right * sec * mpersec;
75
+
76
+}
77
+
78
+void GLCamera::rotateLeft(float sec) {
79
+	roty += apersec * sec;
80
+	rotmatY.set(roty);
81
+	doupdate = true;
82
+// 	rotmat.set(Punkt3D(0.0f, 1.0f, 0.0f), sec*apersec);
83
+// 	dir = rotmat * dir;
84
+// 	dir.normalize();
85
+}
86
+
87
+void GLCamera::rotateRight(float sec) {
88
+	roty -= apersec * sec;
89
+	rotmatY.set(roty);
90
+	doupdate = true;
91
+// statt norm
92
+// 	rotmat.set(Punkt3D(0.0f, 1.0f, 0.0f), -apersec*sec);
93
+// 	dir = rotmat * dir;
94
+// 	dir.normalize();
95
+}
96
+
97
+void GLCamera::rotateUp(float sec) {
98
+	if(rotx+sec*apersec<=90.0f && rotx+sec*apersec>=-90.0f) {
99
+		rotx += sec*apersec;
100
+		rotmatX.set(rotx);
101
+		doupdate = true;
102
+	} else  {
103
+		//std::cout << "zu groß" << std::endl;
104
+	}
105
+// 	rotmat.set(dir.kreuzprodukt(norm), -apersec*sec);
106
+// 	norm = rotmat * norm;
107
+// 	dir = rotmat * dir;
108
+// 	norm.normalize();
109
+// 	dir.normalize();
110
+}
111
+
112
+void GLCamera::rotateDown(float sec) {
113
+	if( (rotx-sec*apersec) >= -90.0f) {
114
+		rotx -= sec*apersec;
115
+		rotmatX.set(rotx);
116
+		doupdate = true;
117
+	}
118
+// 	rotmat.set(dir.kreuzprodukt(norm), apersec*sec);
119
+// 	norm = rotmat * norm;
120
+// 	dir = rotmat * dir;
121
+// 	norm.normalize();
122
+// 	dir.normalize();
123
+}
124
+
125
+float GLCamera::getXrot() {
126
+	return rotx;
127
+}
128
+
129
+float GLCamera::getYrot() {
130
+	return roty;
131
+}
132
+
133
+void GLCamera::print() {
134
+	std::cout << " --- GL Camera --- " << std::endl;
135
+	pos.print("Position");
136
+	norm.print("Normale");
137
+	dir.print("Direction");
138
+	dir.kreuzprodukt(norm).print("Kreuz");
139
+	std::cout << "Rotation X: " << rotx << " Y: " << roty << std::endl;
140
+	rotmatY.print();
141
+	std::cout << " --- End Camera --- " << std::endl;
142
+}
143
+
144
+void GLCamera::renderCoord() {
145
+	glBegin(GL_LINES);
146
+		glColor3f(0.0f, 1.0f, 0.0f);
147
+		glVertex3f(0.0f, -1.0f, 0.0f);
148
+		glVertex3f(0.0f, -1.0f, -5.0f);
149
+	glEnd();
150
+}
151
+
152
+GLCamera::~GLCamera() {
153
+	
154
+}

+ 56
- 0
glcamera.h View File

@@ -0,0 +1,56 @@
1
+#ifndef __GLCAMERA_H
2
+#define __GLCAMERA_H
3
+
4
+#include <iostream>
5
+#include <SDL.h>
6
+#include <SDL_opengl.h>
7
+#include "rotationsmatrix.h"
8
+#include "emath_opengl.h"
9
+#include "punkt3d.h"
10
+
11
+class GLCamera {
12
+	private:
13
+		Punkt3D std_dir;
14
+		Punkt3D std_norm;
15
+	
16
+		Punkt3D pos;
17
+		Punkt3D norm;
18
+		Punkt3D dir;		// normalisiert
19
+		
20
+		float rotx;
21
+		float roty;
22
+		bool doupdate;
23
+		
24
+		float mpersec;
25
+		float apersec;
26
+		
27
+		Rotationsmatrix rotmatX;
28
+		Rotationsmatrix rotmatY;
29
+		
30
+		void updateVectors();
31
+	public:
32
+		GLCamera();
33
+// 		GLCamera(Punkt3d
34
+		
35
+		void setCamera();
36
+		
37
+		// Std Move
38
+		void moveForward(float sec);
39
+		void moveBackward(float sec);
40
+		void moveLeft(float sec);
41
+		void moveRight(float sec);
42
+		void rotateLeft(float sec);
43
+		void rotateRight(float sec);
44
+		void rotateUp(float sec);
45
+		void rotateDown(float sec);
46
+		
47
+		float getXrot();
48
+		float getYrot();
49
+		
50
+		void print();
51
+		void renderCoord();
52
+		
53
+		~GLCamera();
54
+};
55
+
56
+#endif

+ 4
- 0
glcolor.cpp View File

@@ -5,6 +5,10 @@ GLColor::GLColor() {
5 5
 	setalpha = true;
6 6
 }
7 7
 
8
+GLColor::GLColor(float _r, float _g, float _b, float _a) {
9
+	set(_r, _g, _b, _a);
10
+}
11
+
8 12
 GLColor::GLColor(const SDL_Color &c) {
9 13
 	set(c.r/255.0f, c.g/255.0f, c.b/255.0f);
10 14
 	setalpha = true;

+ 1
- 0
glcolor.h View File

@@ -13,6 +13,7 @@ class GLColor {
13 13
 		
14 14
 		
15 15
 		GLColor();
16
+		GLColor(float _r, float _g, float _b, float _a=1.0f);
16 17
 		GLColor(const SDL_Color&);
17 18
 		
18 19
 		void set(float _r, float _g, float _b, float _a=1.0f);

+ 1
- 0
glmenu/menumenu.cpp View File

@@ -87,6 +87,7 @@ void MenuMenu::resetItemPos() {
87 87
 }
88 88
 
89 89
 void MenuMenu::render() {
90
+	
90 91
 	Punkt2D pos = menupos;
91 92
 	pos.y += offset;
92 93
 	if(centerScreenX) {

+ 47
- 40
matrix.cpp View File

@@ -56,6 +56,13 @@ bool Matrix::set(float d, int _m, int _n) {
56 56
 	return true;
57 57
 }
58 58
 
59
+float Matrix::get(int _m, int _n) {
60
+	if(_m>=m||_n>=n)
61
+		return 0.0f;
62
+		
63
+	return c[_m][_n];
64
+}
65
+
59 66
 Matrix Matrix::operator*(const Matrix &d) {
60 67
 	
61 68
 	if(n!=d.m)
@@ -83,45 +90,45 @@ Matrix& Matrix::operator=(const Matrix& mat) {
83 90
 	return *this;
84 91
 }
85 92
 
86
-// Matrix Matrix::operator+(const float &f) {
87
-// 	Matrix tmp(*this);
88
-// 	for(int i=0; i<m; i++) {
89
-// 		for(int j=0; j<n; j++) {
90
-// 			tmp.c[i][j] += f;
91
-// 		}
92
-// 	}
93
-// 	return tmp;
94
-// }
95
-// 
96
-// Matrix Matrix::operator-(const float &f) {
97
-// 	Matrix tmp(*this);
98
-// 	for(int i=0; i<m; i++) {
99
-// 		for(int j=0; j<n; j++) {
100
-// 			tmp.c[i][j] -= f;
101
-// 		}
102
-// 	}
103
-// 	return tmp;
104
-// }
105
-// 
106
-// Matrix Matrix::operator*(const float &f) {
107
-// 	Matrix tmp(*this);
108
-// 	for(int i=0; i<m; i++) {
109
-// 		for(int j=0; j<n; j++) {
110
-// 			tmp.c[i][j] *= f;
111
-// 		}
112
-// 	}
113
-// 	return tmp;
114
-// }
115
-// 
116
-// Matrix Matrix::operator/(const float &f) {
117
-// 	Matrix tmp(*this);
118
-// 	for(int i=0; i<m; i++) {
119
-// 		for(int j=0; j<n; j++) {
120
-// 			tmp.c[i][j] /= f;
121
-// 		}
122
-// 	}
123
-// 	return tmp;
124
-// }
93
+Matrix Matrix::operator+(const float &f) {
94
+	Matrix tmp(*this);
95
+	for(int i=0; i<m; i++) {
96
+		for(int j=0; j<n; j++) {
97
+			tmp.c[i][j] += f;
98
+		}
99
+	}
100
+	return tmp;
101
+}
102
+
103
+Matrix Matrix::operator-(const float &f) {
104
+	Matrix tmp(*this);
105
+	for(int i=0; i<m; i++) {
106
+		for(int j=0; j<n; j++) {
107
+			tmp.c[i][j] -= f;
108
+		}
109
+	}
110
+	return tmp;
111
+}
112
+
113
+Matrix Matrix::operator*(const float &f) {
114
+	Matrix tmp(*this);
115
+	for(int i=0; i<m; i++) {
116
+		for(int j=0; j<n; j++) {
117
+			tmp.c[i][j] *= f;
118
+		}
119
+	}
120
+	return tmp;
121
+}
122
+
123
+Matrix Matrix::operator/(const float &f) {
124
+	Matrix tmp(*this);
125
+	for(int i=0; i<m; i++) {
126
+		for(int j=0; j<n; j++) {
127
+			tmp.c[i][j] /= f;
128
+		}
129
+	}
130
+	return tmp;
131
+}
125 132
 
126 133
 int Matrix::getM() const {
127 134
 	return m;
@@ -135,7 +142,7 @@ void Matrix::print(std::string s) const {
135 142
 	std::cout << "Matrix " << s << "(" << m << "," << n << ")" << std::endl;
136 143
 	for(int a=0; a<m; a++) {
137 144
 		for(int b=0; b<n; b++) {
138
-			std::cout << std::setw(10) << c[a][b];
145
+			std::cout << std::setw(15) << c[a][b];
139 146
 		}
140 147
 		std::cout << std::endl;
141 148
 	}

+ 5
- 4
matrix.h View File

@@ -22,16 +22,17 @@ class Matrix {
22 22
 		
23 23
 		const float **getMatrix() const;
24 24
 		bool set(float, int, int);
25
+		float get(int, int);
25 26
 		int getM() const;
26 27
 		int getN() const;
27 28
 		
28 29
 		Matrix operator*(const Matrix&);
29 30
 		Matrix& operator=(const Matrix&);
30 31
 		
31
-// 		Matrix operator+(const float&);
32
-// 		Matrix operator-(const float&);
33
-// 		Matrix operator*(const float&);
34
-// 		Matrix operator/(const float&);
32
+		Matrix operator+(const float&);
33
+		Matrix operator-(const float&);
34
+		Matrix operator*(const float&);
35
+		Matrix operator/(const float&);
35 36
 
36 37
 		void print(std::string="") const;
37 38
 

+ 34
- 0
punkt3d.cpp View File

@@ -69,6 +69,19 @@ Punkt3D Punkt3D::getOrtographic() {
69 69
 	return erg;
70 70
 }
71 71
 
72
+Punkt3D Punkt3D::getOrtographic2() {
73
+	Punkt3D nullvec;
74
+	Punkt3D erg;
75
+	erg.set(y, -x, 0.0f);
76
+	if(erg!=nullvec)
77
+		return erg;
78
+	erg.set(z, 0.0f, -x);
79
+	if(erg!=nullvec)
80
+		return erg;
81
+	erg.set(0.0f, z, -y);
82
+	return erg;
83
+}
84
+
72 85
 void Punkt3D::print(std::string coordname) {
73 86
 	if(coordname!="")
74 87
 		coordname.append(" ");
@@ -184,6 +197,10 @@ Punkt3D operator/(const float& _m, const Punkt3D& b) {
184 197
 	return Punkt3D(b.x/_m, b.y/_m, b.z/_m);
185 198
 }
186 199
 
200
+std::ostream &operator<<(std::ostream &ostr, const Punkt3D &r) {
201
+	return ostr << "(" << r.x << ", " << r.y << ", " << r.z << ")";
202
+}
203
+
187 204
 float abs(Punkt3D p) {
188 205
 	return p.abs();
189 206
 }
@@ -205,3 +222,20 @@ void glNormal3f(Punkt3D p) {
205 222
 void glRotatef(float deg, Punkt3D vec) {
206 223
 	glRotatef(deg, vec.x, vec.y, vec.z);
207 224
 }
225
+
226
+// Funktionen mit richtgen bezeichnern
227
+void glVertexP3D(Punkt3D p) {
228
+	glVertex3f(p.x, p.y, p.z);
229
+}
230
+
231
+void glTranslateP3D(Punkt3D p) {
232
+	glTranslatef(p.x, p.y, p.z);
233
+}
234
+
235
+void glNormalP3D(Punkt3D p) {
236
+	glNormal3f(p.x, p.y, p.z);
237
+}
238
+
239
+void glRotateP3D(float deg, Punkt3D vec) {
240
+	glRotatef(deg, vec.x, vec.y, vec.z);
241
+}

+ 10
- 0
punkt3d.h View File

@@ -9,6 +9,7 @@ class Punkt3D {
9 9
 	public:
10 10
 		Punkt3D();
11 11
 		Punkt3D(float, float, float);
12
+		~Punkt3D() { }; 
12 13
 		
13 14
 		float x, y, z;
14 15
 		
@@ -20,6 +21,7 @@ class Punkt3D {
20 21
 		bool isNormalized();
21 22
 		float calcAngle(Punkt3D);
22 23
 		Punkt3D getOrtographic();
24
+		Punkt3D getOrtographic2();
23 25
 		
24 26
 		void print(std::string="");
25 27
 		
@@ -50,6 +52,7 @@ class Punkt3D {
50 52
 		friend Punkt3D operator-(const float&, const Punkt3D&);
51 53
 		friend Punkt3D operator*(const float&, const Punkt3D&);
52 54
 		friend Punkt3D operator/(const float&, const Punkt3D&);
55
+		friend std::ostream &operator<<(std::ostream &ostr, const Punkt3D &r);
53 56
 };
54 57
 
55 58
 float abs(Punkt3D);
@@ -62,5 +65,12 @@ void glNormal3f(Punkt3D);
62 65
 
63 66
 void glRotatef(float, Punkt3D);
64 67
 
68
+// Funktionen mit richtgen bezeichnern
69
+void glVertexP3D(Punkt3D);
70
+void glTranslateP3D(Punkt3D);
71
+void glNormalP3D(Punkt3D);
72
+
73
+void glRotateP3D(float, Punkt3D);
74
+
65 75
 
66 76
 #endif

+ 1
- 0
rotationsmatrix.cpp View File

@@ -38,6 +38,7 @@ void Rotationsmatrix::set(axis _ax, float _deg) {
38 38
 
39 39
 void Rotationsmatrix::set(float _deg) {
40 40
 	deg = _deg;
41
+// 	rotvec.print();
41 42
 	initRot();
42 43
 }
43 44
 

Loading…
Cancel
Save