I am working on visualizing a geometry with ROOT, and I need an Ellipsoid.
According to the GDML translation (TGDMLParse.cxx), an Ellipsoid can be created by scaling a sphere, however, when I try to render the resulting object, I do not see a scaled sphere.
There is a question dating back to 2003 (TGeoVolume and scale transformations) that states scaling is not working.
Is this still not working?
If so, any idea how I can get an ellipsoid to show up in a rendering of my geometry?
It seems that the Ellipsoid wasn’t “complete”. I found that putting the bounding box around it, even if it is not cutting anything, DOES create a proper ellipsoid.
Hi,
The following should also do it in GL. Note that due to an optimisation that transforms a full orb into a GL sphere, you have to set the inner radius non-zero to get the proper scaling in GL rendering.
TGeoManager *geom = new TGeoManager("ellipsoid", "");
geom->SetNsegments(80);
TGeoSphere *sphere = new TGeoSphere("sph", 0.01, 50.);
TGeoScaledShape *scaled = new TGeoScaledShape("ell", sphere, new TGeoScale(0.2,0.4,1.));
scaled->Draw("ogl");