Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
1996
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1996

[Date Index] [Thread Index] [Author Index]

Search the Archive

A way to fix coloring

  • To: mathgroup at smc.vnet.net
  • Subject: [mg3201] A way to fix coloring
  • From: Matthias Reinsch <reinsch at tops.lbl.gov>
  • Date: Sat, 17 Feb 1996 14:15:19 -0500
  • Organization: Lawrence Berkeley Laboratory, Berkeley CA
  • Sender: owner-wri-mathgroup at wolfram.com

are colored incorrectly (see ProblemPlot below).  Enclosed in this message
is FastFixColoring, a solution to this problem.  I have already notified
WRI about this, and they suggested I provide this information to other
sites so that users who need correctly colored plots can generate them. 


======================================================================
        An example of a plot in which the coloring has errors:
======================================================================

f = N @ ComplexExpand @ Expand[SphericalHarmonicY[6, 3, th, ph] -
                               SphericalHarmonicY[6,-3, th, ph] ]

ProblemPlot = ParametricPlot3D[ (1+.2 f Sin[6/11 Pi]) *
        {Sin[th] Cos[ph],Sin[th] Sin[ph],Cos[th]}, {th,0,Pi},{ph,0,2 Pi}]

======================================================================
        The corrected plot:
======================================================================

FastFixColoring[gr3D_] := (viewpt = ViewPoint /. gr3D[[2]];
        Graphics3D[ Flatten @ Map[ (p4 = #[[1]];
        p42=Drop[p4,{2}]; p44=Drop[p4,{4}]; m={viewpt,p4[[1]],p4[[1]]};
        If[ Det[m-p44] Det[m-p42] < 0, {Polygon @ p44, Polygon @ p42}, {#}])&,
        gr3D[[1]] ], gr3D[[2]] ] )

Show @ FastFixColoring @ ProblemPlot



==== [MESSAGE SEPARATOR] ====


  • Prev by Date: Re: Help with ErrorListPlot
  • Next by Date: A way to fix coloring
  • Previous by thread: latex <--> mma before 2html
  • Next by thread: A way to fix coloring