From $ROOTSYS/tutorials/eve/projection.C

// @(#)root/eve:$Id$
// Author: Matevz Tadel

// Demonstates usage of automatic 2D projections - class TEveProjectionManager.

const char* esd_geom_file_name =
   "http://root.cern.ch/files/alice_ESDgeometry.root";

void projection()
{
   TFile::SetCacheFileDir(".");
   TEveManager::Create();

   // camera
   TEveScene* s = gEve->SpawnNewScene("Projected Event");
   gEve->GetDefaultViewer()->AddScene(s);
   TGLViewer* v = gEve->GetDefaultGLViewer();
   v->SetCurrentCamera(TGLViewer::kCameraOrthoXOY);
   TGLOrthoCamera& cam = (TGLOrthoCamera&) v->CurrentCamera();
   cam.SetZoomMinMax(0.2, 20);

   // projections
   TEveProjectionManager* mng =
      new TEveProjectionManager(TEveProjection::kPT_RPhi);
   s->AddElement(mng);
   TEveProjectionAxes* axes = new TEveProjectionAxes(mng);
   axes->SetTitle("TEveProjections demo");
   s->AddElement(axes);
   gEve->AddToListTree(axes, kTRUE);
   gEve->AddToListTree(mng, kTRUE);

   // Simple geometry
   TFile* geom = TFile::Open(esd_geom_file_name, "CACHEREAD");
   if (!geom)
      return;

   TEveGeoShapeExtract* gse = (TEveGeoShapeExtract*) geom->Get("Gentle");
   TEveGeoShape* gsre = TEveGeoShape::ImportShapeExtract(gse, 0);
   geom->Close();
   delete geom;
   gsre->SetPickableRecursively(kTRUE);
   gEve->AddGlobalElement(gsre);
   gEve->GetGlobalScene()->SetRnrState(kFALSE);
   mng->ImportElements(gsre);

   TEveLine* line = new TEveLine;
   line->SetMainColor(kGreen);
   for (Int_t i=0; i<160; ++i)
      line->SetNextPoint(120*sin(0.2*i), 120*cos(0.2*i), 80-i);
   gEve->AddElement(line);
   mng->ImportElements(line);
   line->SetRnrSelf(kFALSE);

   gEve->Redraw3D(kTRUE);
}
 projection.C:1
 projection.C:2
 projection.C:3
 projection.C:4
 projection.C:5
 projection.C:6
 projection.C:7
 projection.C:8
 projection.C:9
 projection.C:10
 projection.C:11
 projection.C:12
 projection.C:13
 projection.C:14
 projection.C:15
 projection.C:16
 projection.C:17
 projection.C:18
 projection.C:19
 projection.C:20
 projection.C:21
 projection.C:22
 projection.C:23
 projection.C:24
 projection.C:25
 projection.C:26
 projection.C:27
 projection.C:28
 projection.C:29
 projection.C:30
 projection.C:31
 projection.C:32
 projection.C:33
 projection.C:34
 projection.C:35
 projection.C:36
 projection.C:37
 projection.C:38
 projection.C:39
 projection.C:40
 projection.C:41
 projection.C:42
 projection.C:43
 projection.C:44
 projection.C:45
 projection.C:46
 projection.C:47
 projection.C:48
 projection.C:49
 projection.C:50
 projection.C:51
 projection.C:52
 projection.C:53
 projection.C:54
 projection.C:55
 projection.C:56