Import Geant4 5.2.0 source tree
This commit is contained in:
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4OpenGLViewer.cc,v 1.14 2002/10/16 10:44:16 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
// $Id: G4OpenGLViewer.cc,v 1.18 2003/06/10 17:58:56 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-05-02 $
|
||||
//
|
||||
//
|
||||
// Andrew Walkden 27th March 1996
|
||||
@@ -30,13 +30,10 @@
|
||||
|
||||
#ifdef G4VIS_BUILD_OPENGL_DRIVER
|
||||
|
||||
#include <GL/gl.h>
|
||||
#include <GL/glu.h>
|
||||
|
||||
#include "G4ios.hh"
|
||||
#include "G4OpenGLViewer.hh"
|
||||
#include "G4OpenGLSceneHandler.hh"
|
||||
#include "G4OpenGLTransform3D.hh"
|
||||
#include "G4ios.hh"
|
||||
|
||||
#include "G4Scene.hh"
|
||||
#include "G4VisExtent.hh"
|
||||
@@ -114,9 +111,9 @@ void G4OpenGLViewer::SetView () {
|
||||
const G4double cameraDistance = fVP.GetCameraDistance (radius);
|
||||
const G4Point3D cameraPosition =
|
||||
targetPoint + cameraDistance * fVP.GetViewpointDirection().unit();
|
||||
const GLdouble near = fVP.GetNearDistance (cameraDistance, radius);
|
||||
const GLdouble far = fVP.GetFarDistance (cameraDistance, near, radius);
|
||||
const GLdouble right = fVP.GetFrontHalfHeight (near, radius);
|
||||
const GLdouble pnear = fVP.GetNearDistance (cameraDistance, radius);
|
||||
const GLdouble pfar = fVP.GetFarDistance (cameraDistance, pnear, radius);
|
||||
const GLdouble right = fVP.GetFrontHalfHeight (pnear, radius);
|
||||
const GLdouble left = -right;
|
||||
const GLdouble bottom = left;
|
||||
const GLdouble top = right;
|
||||
@@ -125,10 +122,10 @@ void G4OpenGLViewer::SetView () {
|
||||
glLoadIdentity();
|
||||
|
||||
if (fVP.GetFieldHalfAngle() == 0.) {
|
||||
glOrtho (left, right, bottom, top, near, far);
|
||||
glOrtho (left, right, bottom, top, pnear, pfar);
|
||||
}
|
||||
else {
|
||||
glFrustum (left, right, bottom, top, near, far);
|
||||
glFrustum (left, right, bottom, top, pnear, pfar);
|
||||
}
|
||||
|
||||
glMatrixMode (GL_MODELVIEW); // apply further transformations to scene.
|
||||
|
||||
Reference in New Issue
Block a user