Fw: [Fwd: Colors in OpenGL]

From: Valery Fine (fine@bnl.gov)
Date: Tue Jun 08 1999 - 14:16:24 MEST


     Hello, Norbert

 > Hi Valery,
 >
 > hopefuly i found a solution to the color problem. As you told me a
 > played withe shapes
 > example. I think custom defined colors have to be added to the root list
 > of colors.
 >
 > If I do that the color appears corectly in the OpenGl Window.
 >

    Thank you very much for you kind investigation.

 > I do not know if this is expected behaviour or not.

   As I told I was enable to reproduce your problem with my Windows NT.
   It always worked properly (for > 256 colors). Very likely under UNIX ROOT
   immitates the  "color pallete behaviour" even the real video card doesn't
 (it
   is not use on hardware level for 24K colors display mode).

   May be ROOT team may clarify whether this is expected behaviour unde
  UNIX.
   I am forwarding your solution to RootTalk assuming many people fight the
 same
   problem.

   Thank you.
                                               Valery
> > This is my testcode:
> >
> > {
> >    gROOT->Reset();
> >    Int_t row, col;
> >    Char_t* NodeName[255];
> >    TNode* node1;
> >    TCanvas* c1 = new TCanvas("c1","Geometry Shapes",200,10,700,700);
> > //     TView* View = new TView(1);
> > //     View->SetRange(0,0,0,150,150,150);
> >    TBRIK* brik = new TBRIK("BRIK","BRIK","void",5,5,5);
> >    TBRIK* MARS = new TBRIK("MARS","MARS","void",50,50,50);
> >
> >    TColor* MyCol = new TColor();
> >    MyCol->SetNumber(240);
> >    MyCol->SetRGB(1,0,0);
> >
> >    TList* ColorList = gROOT->GetListOfColors();
> >    Int_t NColors = ColorList->GetSize();
> >    ColorList->Add(MyCol);
> >    printf("found %i defined colors\n",  NColors );
> >
> >    TNode* Mother = new TNode("Mother","Mother","MARS");
> >    Mother->cd();
> >
> >    for(row=0; row<5; row++){
> >      for(col=0; col <10; col++){
> >        sprintf(NodeName,"NODE%i",row*10+col);
> >        node1 = new TNode(NodeName,NodeName,"BRIK",col*10,row*10,0);
> >        node1->SetLineColor(row*10+col+1);
> >      }
> >    }
> >
> >    for(row=4; row<10; row++){
> >      for(col=0; col <10; col++){
> >        sprintf(NodeName,"NODE%i",row*10+col);
> >        node1 = new TNode(NodeName,NodeName,"BRIK",col*10,row*10,0);
> >        node1->SetLineColor(240);
> >      }
> >
> >    }
> >
> >    Mother->SetVisibility(2);
> >    Mother->Draw("same");
> >    c1->Modified();
> >    c1->Update();
> >    c1->x3d("OPENGL");
> > }
>
>



This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:43:34 MET