Skip to content
Snippets Groups Projects
Commit 484a0316 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

Better glOrtho arguments. Check benchmarks/misc/faraway/
parent 8bd47186
No related branches found
No related tags found
No related merge requests found
// $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,
......
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment