summaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 0cc151b..a9d4c74 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -42,6 +42,22 @@ static float orbit_angle = 0.0f;
static float eye_distance = 15.0f;
static float fov = 45.0f;
+GLUmat4 rotate_x_axis(float theta)
+{
+ return GLUmat4 (GLUvec4 (1.0f, 0.0f, 0.0f, 0.0f),
+ GLUvec4 (0.0f, cosf(theta), sinf(theta), 0.0f),
+ GLUvec4 (0.0f, -sinf(theta), cosf(theta), 0.0f),
+ GLUvec4 (0.0f, 0.0f, 0.0f, 1.0f));
+}
+
+GLUmat4 rotate_y_axis(float theta)
+{
+ return GLUmat4 (GLUvec4 (cosf(theta), 0.0f, -sinf(theta), 0.0f),
+ GLUvec4 (0.0f, 1.0f, 0.0f, 0.0f),
+ GLUvec4 (sinf(theta), 0.0f, cosf(theta), 0.0f),
+ GLUvec4 (0.0f, 0.0f, 0.0f, 1.0f));
+}
+
static Uint32 t0;
static GLuint bo;
@@ -473,6 +489,7 @@ timer_callback(Uint32 interval, void *not_used)
return interval;
}
+extern void check_rotation(void);
int
main(int argc, char **argv)
@@ -480,6 +497,8 @@ main(int argc, char **argv)
(void) argc;
(void) argv;
+ check_rotation();
+
if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_TIMER) < 0) {
exit(1);
}