Re: ParametricPlot3D: shading?

*To*: mathgroup at smc.vnet.net*Subject*: [mg4465] Re: [mg4368] ParametricPlot3D: shading?*From*: Allan Hayes <hay at haystack.demon.co.uk>*Date*: Mon, 29 Jul 1996 02:37:20 -0400*Sender*: owner-wri-mathgroup at wolfram.com

lawry at maths.ox.ac.uk (James Lawry) [mg4368] ParametricPlot3D: shading? Is concerned that ParametricPlot3D[{x, y, 1, Hue[x]}, {x, 0, 1}, {y, 0, 1}] colors according to the lighting, while Plot3D[{1, Hue[x]}, {x, 0, 1}, {y, 0, 1}] colors according to the directive Hue[x]. James, Firstly, we can color ParametricPlot3D[..] according to directive by turning the lighting off. ParametricPlot3D[{x, y, 1, Hue[x]}, {x, 0, 1}, {y, 0, 1}, Lighting -> False ] The reason that we don't need to do this for Plot3D[...] and why it is hidden seems to lie in the following. Although we have sg = Plot3D[{1, Hue[x]}, {x, 0, 1}, {y, 0, 1}] -SurfaceGraphics- colored according to the directive Hue[x], with, surprisingly Options[sg, Lighting] {Lighting -> True} The SurfacGraphics object stores only matrices of heights color directives, NOT the polygons that appear in the display.Check with List@@sg Presumably the polygons must be constructed to be displayed. Let's simulate this by converting sg to a Graphics3D object sg3d = Graphics3D[sg] -Graphics3D- Check that the polygons are there: List@@sg3d AND note that the option Lighting -> False has been automatically prepended to the list of options. We can see this without searching all of the code: Options[sg3d, Lighting] {Lighting -> False, Lighting -> True} (1) We can see the graphics code by using InputForm instead of the List@@ trick (which I used to emphasise that no processing was involved) InputForm[sg] (2) It makes the preceding more manageable if we reduce the number of plot points, by using PlotPoints -> 3 for example. (3) Try Show[sg3d, Lighting -> True] Allan Hayes hay at haystack.demon.co.uk ==== [MESSAGE SEPARATOR] ====