Re: 3D viewer in ROOT 4.02

From: Ralf Ehrlich <>
Date: Mon, 7 Mar 2005 16:57:41 -0500 (EST)

Hi Olivier,
the only functionality I'm missing in TViewerOpenGL is updating the 3D display. With TViewerOpenGL::CreateScene("ogl") it is possible to add new objects, but removing objects does not seem to work.

Here is a (very simple) script that demonstrates how I did this with TPadOpenGLView:
  TCanvas *c = new TCanvas;
  c->SetView(new TView(1));

  TPadOpenGLView *d = new TPadOpenGLView(c); //I don't initiate the 3D 
  c->ResetView3D(d);                         //viewer with 
                                             //since I actually use a 
                                             //MyPadOpenGLView class
                                             //which inherits from 
                                             //This new class "overwrites" 
                                             //the ExecuteEvent() method.

  TBRIK *b = new TBRIK("B","B","void",10,10,10);   TNode *n = new TNode("N","N",b);
  n->Draw(); //The 3D window now has the brik.

  TTUBE *t = new TTUBE("T","T","void",10,10);   TNode *n1 = new TNode("N1","N1",t,10,10,10);   n->cd();
  c->Modified(); //The 3D window now has the brik and the tube.

  TSPHE *s = new TSPHE("S","S","void",10);   TNode *n2 = new TNode("N2","N2",s,-10,-10,-10);   n->cd();
  c->Modified(); //The 3D window now had the brik and the sphere,

                  //but the tube has been removed.

Any suggestion how to handle this problem with TViewerOpenGL would be greatly appreciated.

Thank you,

On Mon, 7 Mar 2005, Olivier Couet wrote:

> Hi Ralf,
> The new viewer TViewerOpenGL is under development. A lot of work is
> currently put on that tool. The old way (TPadOpenGLView) will not be
> reactivated, it was unmaintainable and it was not possible to evolve it on
> the long term. Now we have a common interface for all viewer (x3d OpenGL
> etc ...). Many new functionalities have been put in the new OpenGL viewer:
> - color management,
> - transparency,
> - possibility to move object,
> - vector postscript,
> - we are now working on a way to represent the composite shapes,
> - a PadGL is also under investigation to have a even better integration of
> OpenGL in ROOT,
> - etc ...
> May be you can send us a little script showing how you were using
> TPadOpenGLView and what are you missing in TViewerOpenGL. We will help you
> to find a solution.
> Cheers, Olivier
> On Sun, 6 Mar 2005, Ralf Ehrlich wrote:
> > Hello,
> > I have been using the TPadOpenGLView class to get the 3D viewer. This
> > worked very well till ROOT version 4.00/08.
> > Now I'm using ROOT 4.02. This version doesn't have this TPadOpenGLView
> > class anymore - it has been replaced by the TViewerOpenGL class.
> > Unfortunately this new 3D viewer doesn't seem to be updated anymore when
> > the content of its reference TPad changes. This was a feature that worked
> > very well for TPadOpenGLView. Is there a method I can call to
> > update/redraw/... the 3D display? Or would it be possible to bring the old
> > 3D viewer back?
> > Thank you very much,
> > Ralf
> >
> >
Received on Mon Mar 07 2005 - 22:57:57 MET

This archive was generated by hypermail 2.2.0 : Tue Jan 02 2007 - 14:45:05 MET