I have an ellipsoid with parametric equations
lst = {10*Cos[u]*Sin[v], 3*Sin[u]*Sin[v], 2*Cos[v]};
I define a function
dam = Sqrt[(1296*Cos[u]^4*
Sin[v]^4)/(900*Cos[v]^2 + 36*Cos[u]^2*Sin[v]^2 +
400*Sin[u]^2*Sin[v]^2)^2 +
(3600*Cos[u]^2*
Sin[v]^2*(9*Cos[v]^2 + 4*Sin[u]^2*Sin[v]^2))/(900*Cos[v]^2 +
4*(9*Cos[u]^2 + 100*Sin[u]^2)*Sin[v]^2)^2];
and a color function as
colFun = Function[{u, v}, Hue[Rescale[dam, {0, 1}]]];
My ultimate goal is coloring the ellipsoid according to the values of
Rescale[dam, {0, 1}]
So, my question is why there is a big mismatch in the color rendering in the following plots
h = ParametricPlot3D[lst, {u, 0, 2*Pi}, {v, 0, Pi}, Mesh -> False,
ColorFunction -> colFun, ColorFunctionScaling -> False,
ImageSize -> 800];
g = Plot3D[Rescale[dam, {0, 1}], {u, 0, 2*Pi}, {v, 0, Pi},
Mesh -> False, ColorFunction -> colFun,
ColorFunctionScaling -> False, PlotRange -> All];
Row[{Show[h], Show[g, ImageSize -> 400]}]
From g we see that the edges of the ellipsoid should be colored with purple color since for the respective angles {u, v}, dam takes the highest values.
Answer
Does the following:
h = ParametricPlot3D[lst, {u, 0, 2*Pi}, {v, 0, Pi}, Mesh -> False,
ColorFunction -> (Function[{x, y, z, u, v}, Hue[Rescale[dam, {0, 1}]]]),
ColorFunctionScaling -> False, ImageSize -> 800];
g = Plot3D[Rescale[dam, {0, 1}], {u, 0, 2*Pi}, {v, 0, Pi}, Mesh -> False,
ColorFunction -> (Function[{u, v, z}, Hue[Rescale[dam, {0, 1}]]]),
ColorFunctionScaling -> False, PlotRange -> All];
Row[{h, Show[g, ImageSize -> 400]}]

give what you need?
Comments
Post a Comment