Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2001
*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 2001

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

Search the Archive

Function Coloring with ParametricPlot3D

  • To: mathgroup at smc.vnet.net
  • Subject: [mg31264] Function Coloring with ParametricPlot3D
  • From: "David Park" <djmp at earthlink.net>
  • Date: Tue, 23 Oct 2001 21:59:10 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

Dear MathGroup,

There is a percularity of the ParametricPlot3D command with color
specification as the fourth element that bugs me.

It appears that this is the way that the algorithm works. Mathematica
calculates the color that would result from the four corners of the square
and then blends the colors. I suppose that in some sense this can be
considered to be reasonable. But if you write a color function that
specifices a specific set of colors, this blending introduces new colors
which one may not want. Here is an example.

Needs["Graphics`Colors`"]

cfun[x_, y_] :=
 Module[{val = Sqrt[x^2 + y^2]},
  Which[
  val <= 7, PaleGreen,
  val > 7, OrangeRed]]

ParametricPlot3D[{x, y, 0, cfun[x, y]}, {x, 0, 10}, {y, 0, 10},
 PlotPoints -> 8,
 Lighting -> False];

What I would like to do is have Mathematica determine a single function
value for each square, perhaps by averaging the values at the four corners,
and then apply my color function to that single value. In that case there
would be no blending, unless I decide to do the blending in my color
function.

Does anyone know how to work around this?

David Park
djmp at earthlink.net
http://home.earthlink.net/~djmp/




  • Prev by Date: Using a Mathematica's function in a C program
  • Next by Date: Re: How to set font size?
  • Previous by thread: Re: Using a Mathematica's function in a C program
  • Next by thread: Re: Function Coloring with ParametricPlot3D