Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2000

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

Search the Archive

Re: ParametricPlot3D: specific colour AND shading

  • To: mathgroup at
  • Subject: [mg21498] Re: ParametricPlot3D: specific colour AND shading
  • From: "Allan Hayes" <hay at>
  • Date: Wed, 12 Jan 2000 08:35:42 -0500 (EST)
  • Sender: owner-wri-mathgroup at

(apologies for the delay)
Two suggestions,

1) Use white light on  objects colored with the SurfaceColor[ color

<< Graphics`Shapes`

gr1 = Show[Graphics3D[{EdgeForm[], SurfaceColor[Hue[0]], Sphere[1, 25, 25],
          Cylinder[.5, 1.5, 25]}],
      LightSources -> {{{1, 0, 1}, GrayLevel[1]}},
      AmbientLight -> GrayLevel[.1] ];

2) Using the option PolygonIntersections -> False we can combine any number
of Graphics3D images whether obtained with Lighting -> True or with
Lighting ->False
(I am grateful to to Hartmut Wolf for showing me this use of the option)

The crucial fact is that for any Graphics 3D object gr,
looks the same as
 Show[Show[gr, PolynomialIntersections->False], Lighting->False]]
*except that* all options (FaceGrids, ViewPoint ..) are lost.

gr2 = Show[Graphics3D[{EdgeForm[], SurfaceColor[Hue[0]], Sphere[1, 25, 25]},
        LightSources -> {{{1, 0, 1}, GrayLevel[1]}},
        AmbientLight -> GrayLevel[.1] ,
        FaceGrids -> {{-1, 0, 0}, {0, 1, 0}}]];

Take a snapshot that will look like this with Lighting ->False.
Show does not give a  display at this stage -it simply outputs a modified

gr3 = Show[gr2, PolygonIntersections -> False];

but (after deleting warning messages)

gr4 = Show[gr3, Lighting -> False];

Notice that the face grids have been lost.

Here is a carpet shown with Lighting -> False

gr5 = ParametricPlot3D[{x, y, -1, {EdgeForm[], Hue[Random[], .6, 1]}},
      {x, -2, 2}, {y, -2, 2},
      Lighting -> False];

Put the ball on the carpet, and add the options of gr2.

Show[gr4, gr5, Options[gr2]];

Allan Hayes
Mathematica Training and Consulting
Leicester UK
hay at
Voice: +44 (0)116 271 4198
Fax: +44 (0)870 164 0565

jvera at wrote:
> I determine the colour of a ParametricPlot3D
> graphic with a Directive RGBColor. The Option
> Lighting->False is needed for the colour to
> appear.
> The problem is the sense of volume is kind of
> lost, since EdgeForm[] Directive is also present.
> I would like to be able to render graphics with
> both specific colours and shading. A set of
> different graphics with these Directives and Options
> is presented together using the command Show.
> Maybe the Options AmbientLight and Shading have
> something to do with it.
> I looked for this thoroughly (at least I think so) in
> The Mathematica Book and in MathGroup archives, with
> no success.
> Thank you very much for any help.
> Best regards,
> Julio Vera
> Alenar SA
> Uruguay
> Sent via
> Before you buy.

  • Prev by Date: Re: Controlling how Mathematica fits data
  • Next by Date: Re: Unwanted definite-integral complex result from real integrand
  • Previous by thread: Re: ParametricPlot3D: specific colour AND shading
  • Next by thread: CALCULATION TIME