3D Viewers

Hi,

With some recent Root version, in tutorials/rootgeom.C,
there was replaced invoking X3d viewer via pad
with a comment how to change the default viewer
from TPad to GL by setting it in the rootrc configuration
file.
I’d like to ask whether it is possible to change the viewer
directly in the macro instead of modifying the rootrc file.
And also, whether I can invoke in parallel more viewers
(pad, GL, X3D) - and if so, how to do it.

Thank you,

Ivana

Let say you have a TCanvas named c1. At any time you can invoke a 3D viewer on it using:

   c1->GetViewer3D("ogl");

If you want an 3XD viewer instead of an OpenGl one just change “ogl” by “x3d”. Have a look at the end of the file tutorials/shapes.C to see an example.

For the time being only one viewer can be invoke at a time. But we are working on a new version allowing several viewers.

[quote=“ivana”]Hi,

I’d like to ask whether it is possible to change the viewer
directly in the macro instead of modifying the rootrc file.
And also, whether I can invoke in parallel more viewers
(pad, GL, X3D) - and if so, how to do it.

Thank you,

Ivana[/quote]

You can do that with so-called ROOT “Qt Extensions” from root.bnl.gov