On 1 Dec 97 at 16:22, William J. Deninger wrote: > Hello again, > > I've made some wonderful detector geometry views using ROOT which > will help pad my physics thesis. For this, I need to say thank you > again. I do however have one question concerning views which I > haven't been able to resolve on my own. > > When I create a TGeometry and draw it to a TCanvas, the view seems > to be anisotropic. That is, when I resize the window TShapes are > stretched with the frame dimensions. In order to get a view which > isn't severely distorted, my canvas needs to be very tall and > narrow. Are there any remedies for this? > > I'm running ROOT 1.03/05 on a WinNT 3.0 Service Pack 3 Pentium Pro. > Actually the scales of the 3D object "Pad" projection is defined with a cube "max[i]-min[i]", i=0,2 where max[i] and min[i] are the min and max coordinates (x,y,z) of all objects presented. One can take this parameters: TView *view = pad->GetView(); view->GetRange(Float *min, Float *max) and set his own one to replace the default ones: view->SetRange(Float_t *min, Float_t *max); One needs to take in account that TView object is created when 3D object is painted ( not Draw() )for the FIRST time. There is way to call the TPad::Paint() method directly but one can force it calling TPad::Update() just after TPad::Draw(); Another way is to create and set one's own TView object for TPad object before TPad::Draw is called. TView *view = new TView(); pad->SetView(view); pad->Draw(); This way the "default" is not created at all. The user is responsible for setting ALL TView parameters properly. I'd like to highlight that OpenGL view of TPad has TWO types of projection, namely, "Orthographics" (default) and "Perspective" (They are affected with TView::SetRange() as well). One can toggle it by pressing "t" keyboard key. It could be useful to see "long" and narrow objects "properly". To capture the image of the active Windows window one can press "Alt-PrintScreen". Afterwards the the image can be "Paste'd" into any WIN32 documents and printed. Personally myself likes: "LView" just to create GIF, GPEG, BMP etc copy of the Windows Canvas's for Web and docs. I don't know way to create a "vector" PostScript image of the OpenGL screen though. (So by this reason one may prefer the "TPad" way). Otherwise the Orthographics OpenGL view it seems to me what you did ask about. Hope this helps, With my regards, Valery Dr. Valeri Faine (Valery Fine) ------------ ------------- Phone: +41 22 767 4921 CERN FAX : +41 22 767 7155 CH-1211 Geneva, 23 mailto:fine@mail.cern.ch Switzerland http://nicewww.cern.ch/~fine
This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:26:22 MET