TView, CreateView(?)

hi,

I’m having a 3D plot and I’m unsure how CreateView works, and what parameters it takes. I’d like to create a view in which my plot is “in front of me”, by that I mean if I have a cube, I just want to see a square, so I don’t want to look at it from above to see a 3-D shape. TView::CreateView(1) gives me a view which is at an angle, and hence I see a 3D shape of a cube.

Any suggestions?

Thank you

Hi,

Our graphics expert, @couet will help you as soon as he gets back

Cheers, Bertrand.

how soon is that? (:

Beginning of September…

Maybe the TView3D constructor documentation can help (it is what is called by the plugin manager when calling TView::CreateView())

Cheers, Bertrand.

Perhaps all you need is TPad::SetTheta and TPad::SetPhi?

   TF2 *f2 = new TF2("myfunc","-x*y",0,100,0,100);
   f2->SetMinimum(-5E3);
   TCanvas* canvas = new TCanvas("canvas");
   canvas->DivideSquare(2);
   for (int i=0;i<2;i++) {
      canvas->cd(i+1);
      gPad->SetTheta(45*(i+1));
      gPad->SetPhi(-45*(i+1));
      f2->Draw("surf");
   }

1 Like

this one worked perfectly! thanks :blush:

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.