Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2008-03-02 21:21:13 +0000
committerStijn Buys <ingar@osirion.org>2008-03-02 21:21:13 +0000
commit6e08b92bd4f3e32fdf550f0a3e950e3101a1b06f (patch)
tree602e344c9506949f1a3f2d71875778baa23a7e36 /src/client/camera.cc
parenta2acf0f1b4aa830929507c70483f0b1885bf4426 (diff)
Rotated world
Diffstat (limited to 'src/client/camera.cc')
-rw-r--r--src/client/camera.cc23
1 files changed, 14 insertions, 9 deletions
diff --git a/src/client/camera.cc b/src/client/camera.cc
index d9aa16e..e8a6625 100644
--- a/src/client/camera.cc
+++ b/src/client/camera.cc
@@ -52,7 +52,7 @@ float x_offset;
float z_offset;
// default pitch in mode::Track
-const float pitch_track = -15.0f;
+const float pitch_track = 15.0f;
// default rotate offset increase/decrease
float rotate_offset_inc;
// default translate offset increase/decrease
@@ -161,22 +161,27 @@ void draw(float elapsed)
pitch_current = degrees360f( pitch_current - d *elapsed);
}
+ // map world coordinates to opengl coordinates
+ gl::rotate(90.0f, 0, 1.0, 0);
+ gl::rotate(-90.0f, 1.0f , 0, 0);
+
+ // map camera coordinates to opengl coordinates
switch (mode) {
case Free:
- gl::translate(1.0f+distance, -distance/2, 0.0f);
- gl::rotate(-pitch_current, 0, 0, 1.0f);
- gl::rotate(-yaw_current, 0, 1.0f, 0);
+ gl::translate(1.0f+distance, 0.0f, -distance/2);
+ gl::rotate(-pitch_current, 0, 1.0f, 0 );
+ gl::rotate(-yaw_current, 0, 0, 1.0f);
gl::translate(-1*target);
break;
case Track:
- gl::translate(1.0f+distance, -distance , 0.0f);
- gl::rotate(-pitch_current, 0, 0, 1.0f);
- gl::rotate(-yaw_current, 0, 1.0f, 0);
+ gl::translate(1.0f+distance, 0.0f, -distance);
+ gl::rotate(-pitch_current, 0, 1.0f, 0);
+ gl::rotate(-yaw_current, 0, 0, 1.0f);
gl::translate(-1*target);
break;
case Overview:
- gl::rotate(75.0f, 0.0f, 0.0f, 1.0f);
- gl::translate(0.0f, -distance, 0.0f);
+ gl::rotate(-75.0f, 0.0f, 1.0f, 0.0f);
+ gl::translate(0.0f, 0.0f, -distance);
//gl::translate(x_offset, 0.0f, z_offset);
gl::translate(-1*target);
break;