Re: Light and surface colors

• To: mathgroup at smc.vnet.net
• Subject: [mg58696] Re: [mg58688] Light and surface colors
• From: Curtis Osterhoudt <gardyloo at mail.wsu.edu>
• Date: Fri, 15 Jul 2005 03:02:12 -0400 (EDT)
• References: <200507140649.CAA00221@smc.vnet.net>
• Sender: owner-wri-mathgroup at wolfram.com

```Hi, Daniele,

ShadowPlot3D is also borked in that respect in versions 5.1. WRI says
that some default settings have been (perhaps mistakenly) changed in
that function, and so they may well have been changed in many of the
other 3D ones, too. The email I got says that this "will be resolved".

C.O.

Daniele Lupo wrote:

>Hi to everyone.
>
>I've just obtained a Student License of Mathematica, and I'm working in
>graphics...
>
>I've created, after a half-day of work, an image representing an ellipsoid,
>with a colored surface
>
>When I try to represent it, I must put Ligthing->False to see surface
>colors.
>
>I'd like to know if there's a way to obtain a rendered image, in which I
>can have both light and surface color, to give a shadow to the figure and
>create a more 3D effect.
>
>Thanks for replies.
>
>Below there's the code...
>
>
>Daniele
>
>
>--------------------------
>
><< Graphics`ContourPlot3D`;
>
>a = 7; b = 5; c = 4; r = 1;
>
>ellipsoid = ContourPlot3D[
>    (x/a)^2 + (y/b)^2 + (z/c)^2 - r, {
>    x, -10, 10}, {y, -10, 10}, {z, -10, 10},
>    PlotPoints -> 12,
>    AspectRatio -> Automatic
>    ];
>
>(*It finds the median point of vertices of a list of a 3D coordinates*)
>midpoint[l_] := Apply[Plus, Transpose[l], 2]/Length[l];
>
>
>(*Function to map in the ellipsoid surface*)
>pressure[x_, y_, z_] := x^2 + y^2 + Sin[4z];
>
>(*Color Function*)
>color[x_] := Hue[pressure @@ midpoint[x]/50];
>
>(*Rule to change original graphic object*)
>colorpolygon = Polygon[coord_] :>
>{color[coord],EdgeForm[{}],Polygon[coord]};
>
>(*creation of new, colored ellipsoid*)
>coloredellipse = ellipsoid /. colorpolygon;
>
>(*Visualization of the shape*)
>(*I'd like to have also the light...*)
>Show[coloredellipse, Lighting -> False];
>
>
>
>

--
PGP Key ID: 0x235FDED1
Please avoid sending me Word or PowerPoint attachments.
http://www.gnu.org/philosophy/no-word-attachments.html

```

• Prev by Date: Re: positive square root
• Next by Date: Re: Light and surface colors
• Previous by thread: Light and surface colors
• Next by thread: Re: Light and surface colors