MathGroup Archive 2007

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

Search the Archive

Re: Coloring 3D-surfaces

  • To: mathgroup at smc.vnet.net
  • Subject: [mg78427] Re: Coloring 3D-surfaces
  • From: "David Park" <djmpark at comcast.net>
  • Date: Sun, 1 Jul 2007 07:45:18 -0400 (EDT)
  • References: <f65aem$9cc$1@smc.vnet.net>

With the forthcoming DrawGraphics you can do it this way:

Needs["DrawGraphics6`DrawingMaster`"]

Draw3DItems[
 {ParametricDraw3D[{r Cos[t], r Sin[t], 2 r}, {r, 0, 3}, {t, -Pi, Pi},
    ColorFunction -> ColorData["BrassTones"],
   Mesh -> None],
  ParametricDraw3D[{r Cos[t], r Sin[t], 6}, {r, 0, 3}, {t, -Pi, Pi},
   ColorFunction -> ColorData["FuchsiaTones"],
   Mesh -> None]},
 NeutralLighting[0.3, 0.6, 0.0],
 Boxed -> False
 ]

You can also do it with Show except that it behaves a little strangely.

Show[
 {ParametricPlot3D[{r Cos[t], r Sin[t], 2 r}, {r, 0, 3}, {t, -Pi, Pi},
    ColorFunction -> ColorData["BrassTones"],
   Mesh -> None,
   Axes -> False],
  ParametricPlot3D[{r Cos[t], r Sin[t], 6}, {r, 0, 3}, {t, -Pi, Pi},
   ColorFunction -> ColorData["FuchsiaTones"],
   Mesh -> None]},
 Boxed -> False
 ]

Mathematica picks up overall options from the first plot and since that has 
Axes -> True it would draw axes unless we set it to False. With DrawGraphics 
overall plot options are thrown away in the Draw statements and supplied 
specifically by the user for the overall plot. Similarly, when a 
ColorFunction is given Mathematica imposes White lights. DrawGraphics gives 
a little easier control of the lighting.


-- 
David Park
djmpark at comcast.net
http://home.comcast.net/~djmpark/


"Richard KAUSCH" <rkausch at free.fr> wrote in message 
news:f65aem$9cc$1 at smc.vnet.net...
> Hello
> I would color differently a conic surface and the disk which closes it.
> I can do it easily with named colors as follows:
> ParametricPlot[{{r Cos[t],r Sin[t], 2 r},{r Cos[t],r Sin[t},6}},{r,
> 0,3},{t,-Pi,Pi},
> Axes->None,Mesh->False,Boxed->False,
> PlotStyle->{Red,Green}].
>
> It is easy too to have the whole plot coloured with one unique
> ColorData directive, say,BrassTones:
> ParametricPlot[{{r Cos[t],r Sin[t], 2 r},{r Cos[t],r Sin[t},6}},{r,
> 0,3},{t,-Pi,Pi},ColorFunction->(ColorData["BrassTones"][#1]&),
> Axes->None,Mesh->False,Boxed->False,]
>
> But how can one manage to colour the cone with BrassTones and the disk
> with,say,FuchsiaTones or the cone with BrassTones and the disk with
> Red ?
> All trials I made were unsuccessful. Can somebody help me ? Thanks.
>
> 



  • Prev by Date: Re: Graphics package in v6
  • Next by Date: Re: LogLinearPlot and Manipulate
  • Previous by thread: Re: Coloring 3D-surfaces
  • Next by thread: Re: 64-bit