RE: ListSurfacePlot3D
- To: mathgroup at smc.vnet.net
- Subject: [mg41663] RE: [mg41630] ListSurfacePlot3D
- From: "David Park" <djmp at earthlink.net>
- Date: Fri, 30 May 2003 03:56:13 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
Andrea,
You could do something like the following. First I generate some sample
shading data.
sdata = Table[r Sin[t]Cos[t] // N, {r, 0, 1, 1/5}, {t, Pi/2, 3Pi/2, Pi/10}];
smin = Min[sdata];
smax = Max[sdata];
Then we use ListInterpolation to generate an InterpolationFunction. We have
to use a first order interpolation to make certain that the shade function
goes from 0 to 1 and doesn't overshoot.
shade[r_, t_] =
ListInterpolation[(sdata - smin)/(smax - smin), {{0, 1}, {Pi/2, 3Pi/2}},
InterpolationOrder -> 1][r, t]
InterpolatingFunction[{{0., 1.}, {1.5708, 4.71239}}, "<>"][r, t]
Now we can make the plot.
ParametricPlot3D[{r*Cos[t], 0, r*Sin[t], Hue[shade[r, t]]}, {r, 0, 1},
{t, Pi/2, 3/2Pi}, Lighting -> False];
Using DrawGraphics, I could show you how to put a contour plot on the
surface.
David Park
djmp at earthlink.net
http://home.earthlink.net/~djmp/
From: Andrea Miglio [mailto:miglio at merate.mi.astro.it]
To: mathgroup at smc.vnet.net
Hello,
thanks a lot for your mail,
what I need to plot is a surface like the one I simply obtain with
ParametricPlot3D[{fx(r,t),fx(r,t),fx(r,t),
shade(r,t)},{r,r0,r1},{t,t0,t1}]
like
ParametricPlot3D[{r*Cos[t], 0, r*Sin[t], GrayLevel[r]}, {r, 0, 1},
{t,Pi/2, 3/2Pi}, Lighting -> False]
but reading the function shade(r,t) from a data-set stored in a file,
with ListSurfacePlot3D I could not find a way to do that, but it
could be I miss the trivial way to do it .. (I just started using
mathematica)
thanks for your help,
regards,
Andrea Miglio