TH3 & voxels

Slicing’s disabled for glbox2, colored boxes are already some kind of slicing. Use box cut (can be enabled with ‘c’ or ‘C’ to cut part of hist).

Remove TGLHistPainter.h (and, possibly, TGLBoxPainter.h) from $ROOTSYS/include and re-compile.

You have to call gStyle->SetCanvasPreferGL(true); first.

Thanks again, now all the macro in samples/ are working. As regards my macro, it’s not working, even if I add:
gStyle->SetCanvasPreferGL(true);

The error is always the same:
Error in TGLHistPainter::DistancetoPrimitive: Attempt to use TGLHistPainter, while the current pad (gPad) does not support gl
Error in TGLHistPainter::DistancetoPrimitive: Attempt to use TGLHistPainter, while the current pad (gPad) does not support gl

I’m attaching the macro, I don’t understand what’s wrong with it…

Regards
Sara
imageAnalysis.C (4.83 KB)

I’ve played a bit, now my macro is working if I define gStyle->SetCanvasPreferGL(true) inside the macro.
Thanks for helping!
I’ve still to understand how to change/set the palette properly… more later.
Regards
Sara

Volume rendering is a one of methods to visualize 3D data set and I’ll possibly add such a method into ROOT (for TH3). For example, I have 3D data set - 225 slices, each is 256x256. With 3D textures and vertex/fragment shaders it can be painted this way:






Another example, 3D data set: 256x256x256 (something like modified glbox example, but better) with different cuts:






Hi Timur,

It’s been a long time. Thanks for the new features you’ve implemented.
Thanks also to Sara for having extended this post.

I’m contacting you for 3 reasons:

1. I’d like to be able to choose the min and max values for the palette.
histo->SetMinimum() and histo->SetMaximum() do not work.
Looking into the code (gl/src/TGLLegoPainter.cxx), I saw that zMax and fMinZ were calculated.
Could you please allow such a feature?
(Also, could you please make it possible that the palette label be drawn at its right and not ON it?)

2. I’m still interested in [quote]drawing a geometrical object inside the plot (like a box, a cylinder, a sphere) in order to superimpose geometry (wireframe)
and physical results (transparent voxels as in ‘alpha.jpg’) ?
[/quote]Would it be possible to do that with the attached GDML file (just 2 basic cubes side by side: one with 20 cm long edge, the other with 10 cm long edge in a 505050 cm3 world (like the mesh)) ?
To have a look on it:

TGeoManager::Import("cubes.gdml") ; gGeoManager->GetTopVolume()->Draw("ogl") ; // then optionnaly to plot it in a wireframe style TGLViewer *view = (TGLViewer*)gPad->GetViewer3D() ; view->SetStyle(TGLRnrCtx::kWireFrame) ;Maybe that would be easier if the pad from glbox1.C could be displayed in the ROOT GL’s viewer (“View / View With / OpenGL”)… This does not seem to work for the time being.
NB: You have to rename “cubes.txt” in “cubes.gdml” and GDML should be installed: root.cern.ch/phpBB2/viewtopic.php?t=4482
(Mr Webmaster, could you please add GDML file to the “Allowed extensions” list?)

3. I’ve tried to compile the last versions of Root (5.20.00 and 5.21.04) with your changes (Zesp.zip).
It did not work. I got the following odd error message: graf3d/eve/src/TEveBoxSetGL.cxx: In constructor â: graf3d/eve/src/TEveBoxSetGL.cxx:40: error: â was not declared in this scope make: *** [graf3d/eve/src/TEveBoxSetGL.o] Error 1 So I went back to Root_5.19.02 which is fine.
Could you please update Zesp.zip ?

Thanks in advance,
Z
cubes.txt (1.04 KB)

Hi,

I guess Timur will reply about 1. and 3.

About 2 - it is not a straight-forward extension. In pure OpenGL (TGLViewer) we already allow mixing of histograms and other scene objects. The problem is how the scene coordinates are determined from the histogram-axis units.

Right now the histogram is drawn in a unit box … which means it is quite hard to place additional objects. But on the other hand, at least some relative axis scaling will have to be applied to the histogram to make it of reasonable proportions.

Another problem is the histogram axis rendering in pure GL … but much progress has been done on this for other things … so we just have to integrate the functionality.

Anyway, we’ll have to look quite deep into this … I hope to have some time in mid December.

Best,
Matevz

That would be great :smiley:
Thanks Matevz

This does not work for TH3 and both “box”/“glbox” options - for lego it means just truncated bars and axes, for box I do not know what it should be - removal of some boxes?
Since I do not like such an idea I’m not going to change this part now.

It was OK a year ago with ROOT’s trunk. I’ve “ported” these changes for the current ROOT’s trunk, but please note, since this code is not the part of ROOT - this is the last time I’m porting it. If you try it in a year - I will not help you more.
zesp.tar.gz (788 KB)

Hi Timur & Matevz,

Timur
First, thanks for the changes. It perfectly works.
A few comments about your answers : [quote] for lego it means just truncated bars and axes, for box I do not know what it should be - removal of some boxes? [/quote] Not at all. I’m talking about the min and max for the voxel color (and hence the palette color). I’d just like to set them as I want.

[quote] but please note, since this code is not the part of ROOT - this is the last time I’m porting it. [/quote] So why not integrate it? Looking at the number of times this post has been viewed (>3300), this may interest people…

Matevz
Did you have time to integrate progress made on mixing GDML geometries and histograms ?

Thanks guys,
Z