MathGroup Archive 1999

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Plotting different shadings in SphericalPlot3D

  • To: mathgroup at smc.vnet.net
  • Subject: [mg17081] Re: Plotting different shadings in SphericalPlot3D
  • From: "Allan Hayes" <hay at haystack.demon.co.uk>
  • Date: Fri, 23 Apr 1999 02:32:15 -0400
  • References: <7fh1p4$h0j@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Adam:
Change the surface color instead of the lights - except for changing to a
single white light at the end.

<<Graphics`

thing1 =
SphericalPlot3D[{1,SurfaceColor[GrayLevel[.8]]},{t,0,Pi/3},{p,0,2 Pi}]

thing2=
SphericalPlot3D[ {1,SurfaceColor[GrayLevel[.4]]},{t,Pi/3, 2 Pi/3},{p,0,2
Pi}]

thing3 =
SphericalPlot3D[ {1,SurfaceColor[GrayLevel[.8]]},{t,2Pi/3,Pi},{p,0,2 Pi}]


Show[{thing1,thing2,thing3},
LightSources\[Rule]{{{0.0,0.0,1.0},GrayLevel[1]}},
PlotRange->{{-1,1},{-1,1},{-1,1}}]

You could try programming the surface colors in one go, but this did not
produce a sharp transition for me.

See Mathematica in Education and Research Vol 8, No 1, Winter 1999, How and
Why?, p 35.

Allan


---------------------
Allan Hayes
Mathematica Training and Consulting
Leicester UK
www.haystack.demon.co.uk
hay at haystack.demon.co.uk
Voice: +44 (0)116 271 4198
Fax: +44 (0)870 164 0565




<adam.smith at hillsdale.edu> wrote in message news:7fh1p4$h0j at smc.vnet.net...
> Hi:
>
> I am trying to make a plot of a spherical surface that has top and bottom
> "caps" that are a different shade (or color) than the middle "band".
Using
> the code below I can produce 3 separate pictures which look like this. But
> when I try to combine them with Show[ ] the lighting of the first one
listed
> is used for all 3 plots.  Is there an easy way to do this?
>
> Adam Smith
>
> In[1]:=
> <<Graphics`
> In[2]:=
> thing1 = SphericalPlot3D[1,{t,0,Pi/3},{p,0,2 Pi},
>     LightSources\[Rule]{{{0.0,0.0,1.0},GrayLevel[0.8]}},
> PlotRange->{{-1,1},{-1,1},{-1,1}}]
> In[3]:=
> thing2 = SphericalPlot3D[1,{t,Pi/3, 2 Pi/3},{p,0,2 Pi},
>     LightSources\[Rule]{{{0.0,0.0,1.0},GrayLevel[0.4]}},
> PlotRange->{{-1,1},{-1,1},{-1,1}}]
> In[4]:=
> thing3 = SphericalPlot3D[1,{t,2Pi/3,Pi},{p,0,2 Pi},
>     LightSources\[Rule]{{{0.0,0.0,1.0},GrayLevel[0.8]}},
> PlotRange->{{-1,1},{-1,1},{-1,1}}]
> In[5]:=
> Show[{thing1,thing2,thing3}]
>
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own
>



  • Prev by Date: Basic Solid Modelling in Mathematica
  • Next by Date: Re: MATHEMATICA GUIDEBOOK
  • Previous by thread: Plotting different shadings in SphericalPlot3D
  • Next by thread: Re: Plotting different shadings in SphericalPlot3D