OpenGL histogram superimposed on geometry

Hi all,

is there a simple way to superimpose histograms on geometries when drawing using OpenGL?

I would like to include the wireframe geometry in my the histograms I show in the included images.

kind regards

Joa




[quote=“joa”]Hi all,

is there a simple way to superimpose histograms on geometries when drawing using OpenGL?

I would like to include the wireframe geometry in my the histograms I show in the included images.

kind regards

Joa[/quote]

First, it would be good, if you can give here any macros and data to reproduce these pictures.

Hi,

Hm, as usual you hope that there is someone around with the magic fix that has already had
this problem. So with little info given you hope for help from above :blush: Sorry for that. Here are macros to recreate (almost) the images

Joa
histoex.C (132 KB)
Trajectories.C (5.52 KB)

[quote=“joa”]Hi,

Hm, as usual you hope that there is someone around with the magic fix that has already had
this problem. So with little info given you hope for help from above :blush: Sorry for that.

Joa[/quote]

No problem at all, thank you for the code. I’ll check, if there is a possibility to have at least something similar to what you want.

Hi again,

I’ve started to look into how to do this, but have to admit I can’t quite figure out even how to start…
Should I look into drawing my 3D histogram using “glbox”, and then try to get a hold of the viewer and
fill up with my geometry, or the inverse? Will I have to “translate” the histogram into “boxes” or will
I be able to reuse the Painter of the histogram? In short, I have no idea of where to start to look. Have no
experience with these kind of things…

cheers

Joa

Hi,

I’ve found “Eve”, and there I can do something similar to what I want (the tutorial glplot_geom), and I
attached the output from modified version. However, I still would like the look of the histogram that I get in a normal canvas much better than the one in the “Eve viewer”.

From a technical point of view, what is the problem of drawing several objects in the openGL canvas? Not even
the “same” option works ok…

cheers

Joa


[quote=“joa”]Hi,

I’ve found “Eve”, and there I can do something similar to what I want (the tutorial glplot_geom), and I
attached the output from modified version.

[/quote]

Good that you found this.

We started work on this in a separate development branch, but it’s not finished yet. Historically, the reason is in original design - at the beginning nobody was going to “merge” in one picture TGeo objects and 3d histograms/plots, so they exist “independently”.

Hi again,

more progress, but net quite where I want to be… So I tried to recreate the “box” histogram using the TGeo tools. So, I draw my detector and then I add the “boxes”. All fine, see figure. However, I would like to have the
detector volume “filled” but transparent. Is that possible?

The script Trajectories.C will give the picture. histoex.C should be in the same dir.

cheers

Joa
histoex.C (132 KB)
Trajectories.C (6.53 KB)


No, this requires volume rendering, which is not implemented in ROOT.

Hi,

well in that case, I’m back to wanting to put my “wireframe” on the original histograms… That is,
the inverse of what I tried. What would be the starting point to do that?

cheers

Joa

[quote=“joa”]Hi,

well in that case, I’m back to wanting to put my “wireframe” on the original histograms… That is,
the inverse of what I tried. What would be the starting point to do that?

cheers

Joa[/quote]

I suggest you use your geom based code.

P.S. I understand now what you meant by “filled but transparent” - you meant the closed boolean shape. You have the one with holes.
Trajectories.C (6.53 KB)




Hi again,

Yes, I discovered my little error in the geometry. Well, I’ve got something that I’m some what pleased with in the end. Thanks for the help

cheers

Joa



histoex.C (132 KB)
Trajectories.C (6.94 KB)