Plotting an ellipsoid with TGLParametricEquation

Hello,

I need to plot an ellipsoid of revolution. I am using TGLParametricEquation like this:

[code]// Spheroid
// Derived from tutorials/gl/glparametric.C, Author: Timur Pocheptsov

void spheroid () {

gStyle->SetCanvasPreferGL(kTRUE);
TCanvas *c1 = new TCanvas(“canvas”,“Indicatrix”, 100, 10,
1024, 1024);
c1->SetFillColor(42);
gStyle->SetFrameFillColor(42);

TGLParametricEquation *p1 = new TGLParametricEquation(“Spheroid”,
“cos(u)*cos(v)”,
“cos(u)sin(v)",
"2
sin(u)”,
-TMath::Pi()/2., TMath::Pi()/2, -TMath::Pi(), TMath::Pi()
);

p1->Draw();

}[/code]

I expect to see an ellipsoid with unique axis z. Instead I always get a sphere.

I must be missing something.

Thanks for any help,
Roger

Well, at the beginning I had such an option, and parametric equation has a function SetConstrained(true/false), but then in ~ 2009 we had to put all plots into the box, to be able to use them
inside eve/glviewer, since then this option does not work anymore and the resulting surface always fits into the cube. I tried to enable this option back - see attachment - but axes and normals are obviously wrong nowadays.


Thank you.

So, is there some other way that I can use root to generate ellipsoids?

Thanks,
Roger

[quote=“Roger Mason”]Thank you.

So, is there some other way that I can use root to generate ellipsoids?

Thanks,
Roger[/quote]

Yes, sure, with non-parametric equation, as TF3.


Thanks. Got it done.

Cheers,
Roger