diff --git a/Graphics/Trackball.cpp b/Graphics/Trackball.cpp index f32e5b0c65a56d30b25e886ffe22571dbc1f3f9e..f24e76243b88f1dc82936264468c81a0392a2096 100644 --- a/Graphics/Trackball.cpp +++ b/Graphics/Trackball.cpp @@ -54,7 +54,6 @@ * float->double + optional use of hyperbolic sheet for z-rotation) */ #include <math.h> -#include "Gmsh.h" #include "Trackball.h" #include "Context.h" #include <iostream> @@ -195,32 +194,20 @@ trackball(double q[4], double p1x, double p1y, double p2x, double p2y) vsub(p1,p2,d); t = vlength(d); - double _camera; - GmshGetOption("General", "Camera",_camera ); - if (_camera ) t = vlength(d) / (2.0*TRACKBALLSIZE); - t = vlength(d) / (2.0*TRACKBALLSIZE); - /* * Avoid problems with out-of-control values... */ if (t > 1.0) t = 1.0; if (t < -1.0) t = -1.0; phi = 2.0 * asin(t); - /* - * Avoid problems with out-of-control values... - */ - if (t > 1.0) t = 1.0; - if (t < -1.0) t = -1.0; - phi = 2.0 * asin(t); - axis_to_quat(a,phi,q); + axis_to_quat(a,phi,q); } /* * Given an axis and angle, compute quaternion. */ -void -axis_to_quat(double a[3], double phi, double q[4]) +void axis_to_quat(double a[3], double phi, double q[4]) { vnormal(a); vcopy(a,q); @@ -243,7 +230,8 @@ tb_project_to_sphere(double r, double x, double y) if (d < r * 0.70710678118654752440) { // Inside sphere z = sqrt(r*r - d*d); - } else { + } + else { // On hyperbola t = r / 1.41421356237309504880; z = t*t / d; diff --git a/utils/api_demos/mainGlut.cpp b/utils/api_demos/mainGlut.cpp index e16a0dbfafd708e8377504d3841436f601846b4f..1792801bdaeb38d02f7356a54468de26b00231ba 100644 --- a/utils/api_demos/mainGlut.cpp +++ b/utils/api_demos/mainGlut.cpp @@ -420,7 +420,7 @@ int main(int argc, char **argv) GmshSetOption("General", "Camera", 1.); GmshSetOption("General", "Orthographic", 0.); GmshSetOption("General", "TrackballHyperbolicSheet", 0.); - + CTX::instance()->trackballHyperbolicSheet=0; if (strstr(argv[1],"-s") != NULL){ camera.stereoEnable = true; cout<<"mode STEREO"<<endl;