Index: src/TGLLegoPainter.cxx =================================================================== --- src/TGLLegoPainter.cxx (revision 24185) +++ src/TGLLegoPainter.cxx (working copy) @@ -1084,7 +1084,7 @@ glFinish(); fCamera->SetCamera(); - fCamera->Apply(); + fCamera->Apply(fPadPhi, fPadTheta); } //______________________________________________________________________________ Index: src/TGLOrthoCamera.cxx =================================================================== --- src/TGLOrthoCamera.cxx (revision 24185) +++ src/TGLOrthoCamera.cxx (working copy) @@ -506,15 +506,13 @@ } //______________________________________________________________________________ -void TGLOrthoCamera::Apply()const +void TGLOrthoCamera::Apply(Double_t phi, Double_t theta)const { //Applies rotations and translations before drawing glTranslated(0., 0., -fShift); glMultMatrixd(fArcBall.GetRotMatrix()); - glRotated(45., 1., 0., 0.); - glRotated(-45., 0., 1., 0.); - glRotated(-90., 0., 1., 0.); - glRotated(-90., 1., 0., 0.); + glRotated(theta - 90., 1., 0., 0.); + glRotated(phi, 0., 0., 1.); glTranslated(-fTruck[0], -fTruck[1], -fTruck[2]); glTranslated(-fCenter[0], -fCenter[1], -fCenter[2]); } Index: src/TGLBoxPainter.cxx =================================================================== --- src/TGLBoxPainter.cxx (revision 24185) +++ src/TGLBoxPainter.cxx (working copy) @@ -498,7 +498,7 @@ glFinish(); fCamera->SetCamera(); - fCamera->Apply(); + fCamera->Apply(fPadPhi, fPadTheta); } //______________________________________________________________________________ Index: src/TGLSurfacePainter.cxx =================================================================== --- src/TGLSurfacePainter.cxx (revision 24185) +++ src/TGLSurfacePainter.cxx (working copy) @@ -1183,7 +1183,7 @@ glFinish(); fCamera->SetCamera(); - fCamera->Apply(); + fCamera->Apply(fPadPhi, fPadTheta); } //______________________________________________________________________________ Index: src/TGLPlotPainter.cxx =================================================================== --- src/TGLPlotPainter.cxx (revision 24185) +++ src/TGLPlotPainter.cxx (working copy) @@ -43,6 +43,8 @@ : //fGLContext(context), fGLDevice(dev), fPadColor(0), + fPadPhi(45.), + fPadTheta(0.), fHist(hist), fXAxis(hist->GetXaxis()), fYAxis(hist->GetYaxis()), @@ -64,6 +66,10 @@ //TGLPlotPainter's ctor. if (MakeGLContextCurrent()) fCamera->SetViewport(fGLDevice); + if (gPad) { + fPadPhi = gPad->GetPhi(); + fPadTheta = gPad->GetTheta(); + } } //______________________________________________________________________________ @@ -71,6 +77,8 @@ : //fGLContext(context), fGLDevice(dev), fPadColor(0), + fPadPhi(45.), + fPadTheta(0.), fHist(0), fXAxis(0), fYAxis(0), @@ -92,6 +100,10 @@ //TGLPlotPainter's ctor. if (MakeGLContextCurrent()) fCamera->SetViewport(fGLDevice); + if (gPad) { + fPadPhi = gPad->GetPhi(); + fPadTheta = gPad->GetTheta(); + } } //______________________________________________________________________________ @@ -119,7 +131,7 @@ const Float_t pos[] = {0.f, 0.f, 0.f, 1.f}; glLightfv(GL_LIGHT0, GL_POSITION, pos); //Set transformation - shift and rotate the scene. - fCamera->Apply(); + fCamera->Apply(fPadPhi, fPadTheta); fBackBox.FindFrontPoint(); if (gVirtualPS) PrintPlot(); @@ -196,7 +208,7 @@ TGLDisableGuard lightGuard(GL_LIGHTING); glClearColor(0.f, 0.f, 0.f, 0.f); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - fCamera->Apply(); + fCamera->Apply(fPadPhi, fPadTheta); DrawPlot(); glFlush(); fSelection.ReadColorBuffer(fCamera->GetWidth(), fCamera->GetHeight()); Index: inc/TGLOrthoCamera.h =================================================================== --- inc/TGLOrthoCamera.h (revision 24185) +++ inc/TGLOrthoCamera.h (working copy) @@ -115,7 +115,7 @@ void ZoomIn(); void ZoomOut(); void SetCamera()const; - void Apply()const; + void Apply(Double_t phi, Double_t theta)const; Bool_t ViewportChanged()const{return fVpChanged;} Int_t GetX()const; Int_t GetY()const; Index: inc/TGLPlotPainter.h =================================================================== --- inc/TGLPlotPainter.h (revision 24185) +++ inc/TGLPlotPainter.h (working copy) @@ -153,6 +153,8 @@ const TColor *fPadColor; protected: + Double_t fPadPhi; + Double_t fPadTheta; TH1 *fHist; TAxis *fXAxis; TAxis *fYAxis;