RE: 3-D and FillStyle

From: Valery Fine (Faine) (fine@bnl.gov)
Date: Wed Apr 28 1999 - 20:51:03 MEST


Dear Dmitri,
> 
> I seem to be failing to get 'filled' color 3-D 
> shapes in the Canvas, it is always wireframe 
> regardless of the 'SetFillStyle' I assign to it.
> 
> for example:
> 
> root [0] brik = new TBRIK("brik","brik","void",50,50,100);
> root [1] brik->SetFillStyle(1001);
> root [2] brik->SetFillColor(2);   
> root [3] brik->SetLineColor(4);
> root [4] node = new TNode("node","brik","brik");
> root [5] node->cd()
> root [6] node->SetFillStyle(1001);
> root [7] node->SetFillColor(2);   
> root [8] node->SetLineColor(4)
> root [9] node->Draw()
> 
> opens default canvas with wireframed,  not filled box. Edges are blue. 
> 
> If I open x3d viewer and do 'hidden surface' mode, the box 
> is solid blue (though I wanted to have red box with blue edges). 
>  
> Am I doing something wrong or this is what I should have expected?
> 

  In the current implementation of ROOT G3D package only "line color attribute" make
  some sense.
  The "fill attributes" are no use at the moment, that why you met unexpected result.
  Any "style attribute" is no use either.

  What about the colors for X3D. This package doesn't provide any light model. This means
   if your BRIK in solid view will be painted with the color you defined "as is" one will see just 
   a flat polygon (that brik outline)  filled with the color one  supplies. No shape can be recognized
   though

  To avoid this, some "artificial" coloring scheme (introduced by Nenad Buncic) is applied

   Int_t c = ((GetLineColor() % 8) - 1) * 4;     // Basic colors: 0, 1, ... 7

  This means each side of the brik is colored (for X3D) with slightly different color. This way one
  can get an impression of lighting. The "real" lighting and color are provided with OpenGL view 
  only.  The same scheme is applied to shade all other ROOT shapes with X3D package.

  To get a red box with the blue edge you should create a brick with SetLineColor(kRed) and create
  a separate TPolyLine3D object with SetLineColor(kBlue) SetLineWidth(3). May be the size of the
  TPolyLine3D object  should slightly bigger. Then you may assemble everything with your own
   class if any.

    With my best regards,
                                                                       Valery



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