]> git.sur5r.net Git - fstl/blobdiff - src/canvas.cpp
Made models non-mirrored
[fstl] / src / canvas.cpp
index 91db4d71ebd33ae83e9dfd6fcf6606408c54627b..bfbc3c03686a18ec26e802a0bf89864fc1e20e5e 100644 (file)
@@ -107,11 +107,11 @@ QMatrix4x4 Canvas::view_matrix() const
     QMatrix4x4 m;
     if (width() > height())
     {
-        m.scale(height() / float(width()), 1, 0.5);
+        m.scale(-height() / float(width()), 1, 0.5);
     }
     else
     {
-        m.scale(1, width() / float(height()), 0.5);
+        m.scale(-1, width() / float(height()), 0.5);
     }
     return m;
 }
@@ -139,7 +139,7 @@ void Canvas::mouseMoveEvent(QMouseEvent* event)
     {
         auto p = event->pos();
         auto d = p - mouse_pos;
-        yaw = fmod(yaw + d.x(), 360);
+        yaw = fmod(yaw - d.x(), 360);
         tilt = fmax(0, fmin(180, tilt - d.y()));
         mouse_pos = p;
         update();