summaryrefslogtreecommitdiff
path: root/src/Camera.h
diff options
context:
space:
mode:
authorMarius Kintel <marius@kintel.net>2013-09-13 04:49:42 (GMT)
committerMarius Kintel <marius@kintel.net>2013-09-13 04:49:42 (GMT)
commit233406230281d8fefe24902fea52d916dfb3d88e (patch)
tree045c17e47c0c2131903c175662b2d234878878c4 /src/Camera.h
parentb53dde04e2a13c066cfa0c552fe5bd0cdd1b8dbd (diff)
parent54b35a4a844f7f66db43b08a2a557cba7e81e302 (diff)
Merge pull request #472 from openscad/fixcamera1
fix issue #430
Diffstat (limited to 'src/Camera.h')
-rw-r--r--src/Camera.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/Camera.h b/src/Camera.h
index dfc71f8..6079672 100644
--- a/src/Camera.h
+++ b/src/Camera.h
@@ -47,7 +47,8 @@ public:
projection = Camera::PERSPECTIVE;
}
- void setup( std::vector<double> params ) {
+ void setup( std::vector<double> params )
+ {
if ( params.size() == 7 ) {
type = Camera::GIMBAL;
object_trans << params[0], params[1], params[2];
@@ -62,6 +63,16 @@ public:
}
}
+ void gimbalDefaultTranslate()
+ { // match the GUI viewport numbers (historical reasons)
+ object_trans.x() *= -1;
+ object_trans.y() *= -1;
+ object_trans.z() *= -1;
+ object_rot.x() = fmodf(360 - object_rot.x() + 90, 360 );
+ object_rot.y() = fmodf(360 - object_rot.y(), 360);
+ object_rot.z() = fmodf(360 - object_rot.z(), 360);
+ }
+
// Vectorcam
Eigen::Vector3d eye;
Eigen::Vector3d center; // (aka 'target')
contact: Jan Huwald // Impressum