Re: 3d Custom Color Output
- To: mathgroup at smc.vnet.net
- Subject: [mg17254] Re: 3d Custom Color Output
- From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
- Date: Fri, 30 Apr 1999 02:34:41 -0400
- Organization: Universitaet Leipzig
- References: <7g0r1g$drr@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Hi Christian,
here is the solution with out a color average
gr=ParametricPlot3D[
{Cos[u]*Sin[v],Sin[u]*Sin[v],Cos[v],SaveUV[u,v]},{u,0,2Pi},{v,0,Pi},
DisplayFunction->Identity];
SaveUV[_,_] serves only as a dummy. It creates no error message because
the graphic is not converted to PostScript. The result is something like
Graphics3D[{{SaveUV[valu,valv],Polygon[_]},..},_]
in the second step the SaveUV[] structure is converted to a valid
color directive and you can display it without any problem:
Define a discontinuous color function like
myColor[u_,v_]:=Module[{r,g},
r=If[u<Pi,1,0];
g=If[v<Pi/2,1,0];
SurfaceColor[RGBColor[r,g,0]]
]
and convert the SaveUV[]'s to colors with
Show[gr /. SaveUV[u_,v_]:>
myColor[u,v],DisplayFunction->$DisplayFunction]
Hope that helps
Jens
Christian Exner wrote:
>
> 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