I have generated a view of a TPolyMarker3D to view as a point cloud. I now need to add some decorations to it but am having a hard time understanding the TGAxis format. Everytime that I rotate the plot or translate it will I need to manually repaint the axis? Is there a nice way to pull this off without having to writre a bunch of mainanence code?
Yhea…
I just now saw the TView::ShowAxis method.
/me cowers in the corner
Next list some code about how to show axis for TPolyMarker3D points
TView *v = TView::CreateView();
v->ShowAxis();
TPolyMarker3D* marker = new TPolyMarker3D(1);
marker->Draw();
You may try it.
An other way:
{
gStyle->SetOptStat(0);
TH3F *frame3d = new TH3F("frame3d","frame3d",10,-1,1,10,-1,1,10,-1,1);
frame3d->Draw();
TPolyMarker3D *pm3d1 = new TPolyMarker3D(3);
pm3d1->SetPoint(0,1,0,0);
pm3d1->SetPoint(1,0,1,0);
pm3d1->SetPoint(2,0,0,1);
pm3d1->SetMarkerSize(2);
pm3d1->SetMarkerColor(kBlue);
pm3d1->SetMarkerStyle(20);
pm3d1->Draw();
TPolyMarker3D *pm3d2 = new TPolyMarker3D(3);
pm3d2->SetPoint(0,-1,0,0);
pm3d2->SetPoint(1,0,-1,0);
pm3d2->SetPoint(2,0,0,-1);
pm3d2->SetMarkerSize(2);
pm3d2->SetMarkerColor(kRed);
pm3d2->SetMarkerStyle(20);
pm3d2->Draw();
}
I test the macro on my computer, It works very well. Thank you.