Re: [ROOT] Query about 3-d drawing classes

From: Valeri Fine (fine@bnl.gov)
Date: Sun Mar 31 2002 - 06:13:05 MEST


> I am new to root, and have been trying to use the 3-d drawing classes.
> Does anybody have a simple example of ray-tracing through a target?
> Is there a tutorial or set of examples anywhere? The Root User's Guide
> has none, and the examples in $ROOTSYS/tutorials are not very complete.
> 

   Hi Tom.

> I have several puzzles:
>  1) I don't understand what coordinates are being used. For instance,
>     when I change the {dx,dy,dz} in a TBRIK constructor the picture
>     does not change. It looks like there is some sort of automatic
>     scaling going on (this TBRIK is the only object). I guess I'll 
>     just draw an invisible TBRIK object enclosing the entire system.

   Just an advice, if you draw a 3D object onto TCanvas then you can
   select that object with "irght mouse button" and call "ShowAxis" method.
   ROOT selects automatically the different scales to fill the entire TCanvas area.

>  2) The TBRIK object does not seem to fill itself. I tried many 
>     variations on SetFillColor() and SetFillStyle(). None worked.

     Uaaa, the attribiutes are coming from TNode object. try to manage that.

>  3) I cannot figure out how to get TPolyLine3D to display its line.
>     This could be related to (1) and the coordinates are simply off 
>     the screen. Using a thin and narrow TBRIK for each ray is difficult, 
>     as I need to figure out how to rotate them....

     Try "basic3d.C macro from $ROOTSYS/tutorials

>  4) the TNode-s seem to automatically link themselves together in
>     a list. The use of TNode::cd() is rather puzzling. Anybody know
>     what is going on?

     Try TVolume instead of TNode

>  5) TGeometry seems to be related to this, but shapes.C does not use
>     one, and the nodes (or shapes ?) seem to be linked into the canvas?

> 
> Below is my test script, based upon tutorials/shapes.C. The TBRIK
> object displays its lines, and I can rotate it using the mouse,
> but it is not filled. 
> 
> Any help or pointers would be appreciated.
> 
> 
> Tom Roberts tjrob@fnal.gov
> 
> 
> {
>    c1 = new TCanvas("c1","Test Ray-Tracing",800,600);
>    c1->SetFillColor(10);
>  
>    TBRIK *tgt = new TBRIK("Target","Target","void",150,150,150);
>    tgt->SetLineColor(1);
>    tgt->SetFillColor(2);
>    tgt->SetFillStyle(1001);
>  
>    //  Build the geometry hierarchy
>    node1 = new TNode("NODE1","NODE1",tgt);
>    node1->cd();
>  
>    // Draw this geometry in the current canvas
>    node1->cd();
>    node1->Draw();
>    c1->Update();
> }
> 



This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:50:47 MET