Re: 3d Custom Color Output
- To: mathgroup at smc.vnet.net
- Subject: [mg17282] Re: 3d Custom Color Output
- From: "Allan Hayes" <hay at haystack.demon.co.uk>
- Date: Fri, 30 Apr 1999 23:22:20 -0400
- References: <7g0r1g$drr@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Christian,
With
ParametricPlot3D[{fx[u,t],fy[u,t],fz[u,t],MyColor[n1[u,t], n2[u,t] ...]},
{u,0,2 Pi},{z,0,zmax},Lighting->False]
(where ni[u,t] are numerical functions and no further numerical evaluation
is possible, eg
RGBColor[ u, Sin[u t], u + t])
it seems that the polygons are colored by
MyColor[av[n1[u,t],av[n2[u,t],...]
where av[ni[u,t]] is the average of ni[u,t] over the u, t giving the
vertices.
This is why you get the orange color.
You may be able to define functions suitable for your purpose.
Another way round this, if you want the color to depend on the polygon but
not on the parameters, is to operate on the Graphics3D object gr generated
by ParametricPlot3D by using a suitable function MyColor in the following
g gr /. {dirs___, p : Polygon[pts]} :> {dirs, MyColor[pts], p}
Or one could get at the polygons more directly, say by their position in gr.
Can you give more information about what you want to do please?
You might like to look at my column How and Why? in Mathematica in Education
and Research Volume 8, No 1, Winter 1999, p 35
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
Christian Exner <e8625320 at stud1.tuwien.ac.at> wrote in message
news:7g0r1g$drr at smc.vnet.net...
> Hi!
>
> I am trying to get a Color Output of a 3D Plot with my own Colors
> defined, but Mathematica always interpolates the Color Fields I defined.
>
> I am using Mathematica 3.0 for PC. And I am using
>
> ParametricPlot[{fx[u,t],fy[u,t],fz[u,t],MyColor[u,t]},
> {u,0,2 Pi},{z,0,zmax},Lighting->False]
>
> to create the graphic, with MyColor to assing a color to every polygon.
> I have also tried FaceForm[MyColor[u,t]] but it does not work either.
> If my surface changes color from red to yellow, for instance,
> Mathematica always interpolates one stripe to become orange. MyColor has
> no orange defined (I am using constant colors in MyColor, such as
> RGBColor[1,0,0] )
>
> How can I find solution to this problem
>
> Every suggestion is welcomed after I spend a week now over this
> problem!!
>
> Thanx in advance
> Christian
>
>
>
> ------------------------------------------------------------------------
>
> Dipl.-Ing. Christian Exner Tel.+43-1-58801-13473
> Institut fuer Allgemeine Physik Fax.+43-1-586 42 03
> TU Wien email: exner at iap.tuwien.ac.at
> Wiedner Hauptstrasse 8-10/134
> A-1040 Wien
> Austria
>