diff --git a/Graphics/Draw.cpp b/Graphics/Draw.cpp index bc7beb42c3f7c9e7078e2707615615dad8ce36c3..6ad545063d05cbd1cbf9287074a23d8ad7a7ab83 100644 --- a/Graphics/Draw.cpp +++ b/Graphics/Draw.cpp @@ -1,4 +1,4 @@ -// $Id: Draw.cpp,v 1.42 2003-03-26 16:57:07 geuzaine Exp $ +// $Id: Draw.cpp,v 1.43 2003-03-26 20:14:01 geuzaine Exp $ // // Copyright (C) 1997-2003 C. Geuzaine, J.-F. Remacle // @@ -26,6 +26,7 @@ #include "Draw.h" #include "Context.h" #include "MinMax.h" +#include "Numeric.h" extern Context_T CTX; extern Mesh M; @@ -138,15 +139,16 @@ void Orthogonalize(int x, int y) // We should have a look at how the scaling is done in "real" opengl // applications (I guess they normalize the scene to fit in a 1x1x1 - // box or something...): + // box or something...). Here, we set up a large box around the + // object, so that if we zoom a lot the resolution of the depth + // buffer might become insufficient... if(CTX.ortho) { - // Warning: for large s (i.e. big zooms) the PolygonOffset will - // degrade... - double clip = CTX.s[2] * 10; - glOrtho(CTX.vxmin, CTX.vxmax, CTX.vymin, CTX.vymax, 0, clip * CTX.lc); + double maxz = MAX(fabs(CTX.min[2]), fabs(CTX.max[2])); + if(maxz < CTX.lc) maxz = CTX.lc; + double clip = maxz * CTX.s[2] * 10; + glOrtho(CTX.vxmin, CTX.vxmax, CTX.vymin, CTX.vymax, -clip, clip); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); - glTranslated(0.0, 0.0, -clip/2 * CTX.lc); } else { glFrustum(CTX.vxmin, CTX.vxmax, CTX.vymin, CTX.vymax, CTX.lc, diff --git a/tutorial/t3.geo b/tutorial/t3.geo index 0e590118fe9412487157d4afa93e48dd52f8199f..4931c957e4dc2c1df40099d25c2af98b1a1a4c57 100644 --- a/tutorial/t3.geo +++ b/tutorial/t3.geo @@ -57,6 +57,10 @@ General.Color.Text = White; Geometry.Color.Points = Orange; General.Axes = 0; General.Trackball = 0; +General.RotationCenterGravity = 0; +General.RotationCenterX = 0; +General.RotationCenterY = 0; +General.RotationCenterZ = 0; General.RotationX = 10; General.RotationY = 70; General.TranslationX = -0.2;