How to draw two intersected ellipsoids?

Hello,

I’m trying to draw two intersected ellipsoids, but I can’t find what classes
to use. I’ve tried the TGLParametricEquation class, however, there is no
draw option like “same” to draw two ellipsoids in one pad and also there are
no axes shown. I also tried searching this forum, but with no results on
ellipsoids. Could anyone please tell me how to do this? Thanks in advance.

Hongxuan

[quote]
Hello,

I’m trying to draw two intersected ellipsoids, but I can’t find what classes
to use. I’ve tried the TGLParametricEquation class, however, there is no
draw option like “same” to draw two ellipsoids in one pad and also there are
no axes shown. I also tried searching this forum, but with no results on
ellipsoids. Could anyone please tell me how to do this? Thanks in advance.

Hongxuan[/quote]

I think, you can simply do this with TGeo classes (though, you’ll have to specify ellipsoids using their dimensions, not functions).

Hi Hongxuan,

You can use scaled spheres to do that - see attached examples.

Cheers,
draw_ell1.C (1.45 KB)
draw_ell.C (1.43 KB)

Thanks for you help. It works! But I still have a question, how to save the plots in a ps file? The TCanvas::Print(“xxx.eps”) does not work. Is there any specific functions related to the TGeo output to a ps file?

[quote=“agheata”]Hi Hongxuan,

You can use scaled spheres to do that - see attached examples.

Cheers,[/quote]

You can save only as gif because the output is a bitmap (you may use a convertor to eps after). If viewing with OpenGL you can export also eps, but you may lose some functionality. An alternative is to use Draw() instead of Raytrace() but you lose the solid mode drawing.

Cheers,