Re: ParametricPlot3D: specific colour AND shading
- To: mathgroup at smc.vnet.net
- Subject: [mg21498] Re: ParametricPlot3D: specific colour AND shading
- From: "Allan Hayes" <hay at haystack.demon.co.uk>
- Date: Wed, 12 Jan 2000 08:35:42 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
Julio: (apologies for the delay) Two suggestions, 1) Use white light on objects colored with the SurfaceColor[ color directive] << Graphics`Shapes` gr1 = Show[Graphics3D[{EdgeForm[], SurfaceColor[Hue[0]], Sphere[1, 25, 25], SurfaceColor[Hue[.8]], 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, Show[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 object. 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 --------------------- 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 jvera at adinet.com.uy 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 Deja.com http://www.deja.com/ > Before you buy.