Rotate View of Canvas

Hello!

I want to rotate the view of my canvas, unfortunately I cannot set the view angle i want with the “SetTheta” and
"SetPhi" methods of TCanvas.

I tried TView like this:

int res = 3000;
TCanvas * theCanvas = new TCanvas("3DCT","3DCT",
							-res/2.,res/2.
							res,res);
gStyle -> SetCanvasPreferGL(true);
gSystem -> Load("libGeom");

TView * theView = TView::CreateView(1);
int irep;
theView -> SetView(phi,theta,psi,irep)

theCanvas -> SetView(theView);

...

but that does nothing. What is Psi by the way, I thought it would be the third angle of rotation that I need but it doesnt do anything if I change it and I cannot find an explanation in the documentation.

And does anybody know how the “DefineViewDirection” method works? I cannot realy get anything from the
documentation but it sounds like I could use it.

best regards

Badger

In the following example SetView seems to work.

{
   cV3D = new TCanvas("cV3D","PolyLine3D & PolyMarker3D Window",200,10,500,500);

   // Creating a view
   TView3D *view = (TView3D*) TView::CreateView(1);
   view->SetRange(5,5,5,25,25,25);
   int irep;
   view->SetView(90,90,90,irep);

   // Create a first PolyLine3D
   TPolyLine3D *pl3d1 = new TPolyLine3D(6);
   pl3d1->SetPoint(0, 10, 20, 10);
   pl3d1->SetPoint(1, 15, 15, 15);
   pl3d1->SetPoint(2, 20, 20, 20);
   pl3d1->SetPoint(3, 20, 10, 20);
   pl3d1->SetPoint(4, 10, 10, 20);
   pl3d1->SetPoint(5, 10, 10, 10);

   // Create a first PolyMarker3D
   TPolyMarker3D *pm3d1 = new TPolyMarker3D(9);
   pm3d1->SetPoint( 0, 10, 10, 10);
   pm3d1->SetPoint( 1, 20, 20, 20);
   pm3d1->SetPoint( 2, 10, 20, 20);
   pm3d1->SetPoint( 3, 10, 10, 20);
   pm3d1->SetPoint( 4, 20, 20, 10);
   pm3d1->SetPoint( 5, 20, 10, 10);
   pm3d1->SetPoint( 6, 20, 10, 20);
   pm3d1->SetPoint( 7, 10, 20, 10);
   pm3d1->SetPoint( 8, 15, 15, 15);
   pm3d1->SetMarkerSize(2);
   pm3d1->SetMarkerColor(4);
   pm3d1->SetMarkerStyle(2);

   // Draw
   pl3d1->Draw();
   pm3d1->Draw();
}