diff options
author | don bright <hugh.m.bright@gmail.com> | 2013-03-06 03:10:10 (GMT) |
---|---|---|
committer | don bright <hugh.m.bright@gmail.com> | 2013-03-06 03:10:10 (GMT) |
commit | 974abf13049d5e73227418e3990af8a9bbf9db09 (patch) | |
tree | e1161129a3a05c63344cd009bd2d2705c3fa3e2c | |
parent | 51be86ad29fe3012d46e81e279a66c76d79a052a (diff) |
fix strecthing with --imgsize per bug rept from Marius Kintel
-rw-r--r-- | src/GLView.cc | 6 | ||||
-rw-r--r-- | src/openscad.cc | 9 | ||||
-rw-r--r-- | tests/CMakeLists.txt | 1 |
3 files changed, 9 insertions, 7 deletions
diff --git a/src/GLView.cc b/src/GLView.cc index f21e044..b4fb8d6 100644 --- a/src/GLView.cc +++ b/src/GLView.cc @@ -74,7 +74,7 @@ void GLView::setupVectorCamPerspective() glMatrixMode(GL_PROJECTION); glLoadIdentity(); double dist = (cam.center - cam.eye).norm(); - gluPerspective(45, w_h_ratio, 0.1*dist, 100*dist); + gluPerspective(45, pow(w_h_ratio,2), 0.1*dist, 100*dist); } void GLView::setupVectorCamOrtho(bool offset) @@ -83,8 +83,8 @@ void GLView::setupVectorCamOrtho(bool offset) glLoadIdentity(); if (offset) glTranslated(-0.8, -0.8, 0); double l = (cam.center - cam.eye).norm() / 10; - glOrtho(-w_h_ratio*l, +w_h_ratio*l, - -(1/w_h_ratio)*l, +(1/w_h_ratio)*l, + glOrtho(-pow(w_h_ratio,2)*l, +pow(w_h_ratio,2)*l, + -(1/pow(w_h_ratio,2))*l, +(1/pow(w_h_ratio,2))*l, -far_far_away, +far_far_away); } diff --git a/src/openscad.cc b/src/openscad.cc index 354c347..75d7b9d 100644 --- a/src/openscad.cc +++ b/src/openscad.cc @@ -77,10 +77,11 @@ static void help(const char *progname) int tab = int(strlen(progname))+8; fprintf(stderr,"Usage: %s [ -o output_file [ -d deps_file ] ]\\\n" "%*s[ -m make_command ] [ -D var=val [..] ] [ --render ] \\\n" - "%*s[ --camera= [x,y,z,rotx,y,z,dist] | [eyex,y,z,centerx,y,z] ] \\\n" - "%*s[ --imgsize=width,height ] [ --projection=o|p] \\\n" + "%*s[ --camera=translatex,y,z,rotx,y,z,dist | \\\n" + "%*s --camera=eyex,y,z,centerx,y,z ] \\\n" + "%*s[ --imgsize=width,height ] [ --projection=(o)rtho|(p)ersp] \\\n" "%*sfilename\n", - progname, tab, "", tab, "", tab, "", tab, ""); + progname, tab, "", tab, "", tab, "", tab, "", tab, ""); exit(1); } @@ -127,7 +128,7 @@ Camera get_camera( po::variables_map vm ) else if (proj=="p" || proj=="perspective") camera.projection = Camera::PERSPECTIVE; else { - fprintf(stderr,"projection needs to be 'o' or 'p' for ortho or perspective"); + fprintf(stderr,"projection needs to be 'o' or 'p' for ortho or perspective\n"); exit(1); } } diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 47d21ac..9d8e26f 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -373,6 +373,7 @@ inclusion(CGAL_DIR CGAL_INCLUDE_DIRS) if(CMAKE_CXX_COMPILER MATCHES ".*clang.*") string(REPLACE "-frounding-math" "" CGAL_CXX_FLAGS_INIT ${CGAL_CXX_FLAGS_INIT}) + string(REPLACE "--param=ssp-buffer-size=4" "" CGAL_CXX_FLAGS_INIT ${CGAL_CXX_FLAGS_INIT}) endif() # Imagemagick |