Re: TRotMatrix
Rene Brun (Rene.Brun@cern.ch)
Mon, 30 Mar 1998 17:19:31 +0200
Rutger van der Eijk wrote:
>
> Hi all,
>
> I'm using the rotation matrix 'normal constructor' (i.e.
>
> TRotMatrix(Text_t *name, Text_t *title, Double_t theta, Double_t phi,
> Double_t psi);
>
> )
>
> to define a rotation matrix so that I can use for rotating a shape in a
> geometry defintion. When I apply the matrix to my shape (i.e. in the node)
> it doesn't rotate at all.
>
> A simplified version of my macro:
>
> {
> gROOT->Reset();
> c2 = new TCanvas("c2","ott geometry test",200,10,700,500);
>
> // Define volumes
> cave = new TBRIK("CAVE","CAVE","void",1000,1000,5000);
> cell5 = new TTUBE("CELL5","CELL5","void",5,6,980);
>
> // Define rotation matrices
> rotX = new TRotMatrix("rotX","rotX",90,0,0);
>
> // Build geometry hierachy
> node1 = new TNode("NODE1","NODE1","CAVE");
> node1->cd();
> node2 = new TNode("NODE2","NODE2","CELL5",100,100,0,"rotX");
>
> // Draw geometry
> node1->cd();
> node1->Draw();
>
> c2->Update();
> }
>
> so node2 is always drawn parallel to the z-axis. I was wondering if I was
> doing something wrong, so I used the 'GEANT constructor' of TRotMatrix and
> found out that it DOES rotate. Looking at the source code of the first
> (i.e. 'normal') constructor I see that the fMatrix datamember is set equal
> to the identity matrix. This looks like a bug to me. Am I right?
>
> Rutger
You are unfortunately right!
TRotMatrix has 2 constructors. The only one implemented now
is the "Geant-like" constructor.
We intend to implement the second form (simpler) in a future version.
We should have put a Warning/Error message in this dummy constructor.
Rene Brun