27 static Double_t center[3] = {-164.0, -164.0, -180.0};
31 static Double_t fovStep = randGen.Rndm() * 3.0 - 0.5;
32 static Double_t zoomStep = (20 - randGen.Rndm()) / 1000.;
33 static Double_t dollyStep = randGen.Rndm() * 5.0 - 1.0;
34 static Double_t centerStep[3] = {randGen.Rndm() * 4, randGen.Rndm() * 4, randGen.Rndm() * 4};
35 static Double_t hRotateStep = randGen.Rndm() * 0.025;
36 static Double_t vRotateStep = randGen.Rndm() * 0.05;
39 center[0] += centerStep[0];
40 center[1] += centerStep[1];
41 center[2] += centerStep[2];
42 Double_t mag =
TMath::Sqrt(center[0] * center[0] + center[1] * center[1] + center[2] * center[2]);
44 centerStep[0] = -centerStep[0];
45 centerStep[1] = -centerStep[1];
46 centerStep[2] = -centerStep[2];
50 hRotate += hRotateStep;
51 vRotate += vRotateStep;
53 vRotateStep = -vRotateStep;
56 hRotateStep = -hRotateStep;
61 if (dolly >= 2000.0 || dolly <= 1500.0)
62 dollyStep = -dollyStep;
69 if (fov > 130.0 || fov < 5.0)
73 if (zoom > 4.0 || zoom < 0.25)
79 v->SetPerspectiveCamera(camera, fov, dollyStep, center, hRotateStep, vRotateStep);
81 v->SetOrthoCamera(camera, zoom, dollyStep, center, hRotateStep, vRotateStep);
83 if (++moveCount % 10 == 0)
84 v->RefreshPadEditor(
v);
87void glViewerExercise()
89 gROOT->ProcessLine(
".x nucleus.C");
103 if (randGen.Integer(2) == 0)
105 if (randGen.Integer(2) == 0)
107 if (randGen.Integer(2) == 0)
109 if (randGen.Integer(2) == 0)
113 Int_t id = randGen.Integer(6);
115 v->SetCurrentCamera(camera);
116 v->CurrentCamera().SetExternalCenter(
kTRUE);
126 sav->
GetFrame()->
Connect(
"CloseWindow()",
"TTimer", &timer,
"TurnOff()");
127 timer.SetCommand(
"AnimateCamera()");
int Int_t
Signed integer 4 bytes (int).
double Double_t
Double 8 bytes.
Encapsulates a set of lights for OpenGL.
void SetLight(ELight light, Bool_t on)
Set a light on/off.
Orthographic projection camera.
void SetEnableRotate(Bool_t x)
The top level standalone GL-viewer - created via plugin manager.
TGCompositeFrame * GetFrame() const
Return the main-frame.
Base GL viewer object - used by both standalone and embedded (in pad) GL.
Bool_t Connect(const char *signal, const char *receiver_class, void *receiver, const char *slot)
Non-static method is used to connect from the signal of this object to the receiver slot.
This is the base class for the ROOT Random number generators.
Handles synchronous and a-synchronous timer events.
constexpr Double_t PiOver2()
Double_t Sqrt(Double_t x)
Returns the square root of x.
constexpr Double_t TwoPi()