MathGroup Archive 2002

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

Search the Archive

Mathematica's color limitations

  • To: mathgroup at smc.vnet.net
  • Subject: [mg34406] Mathematica's color limitations
  • From: "Michael Math" <michael-math at science.edu>
  • Date: Sat, 18 May 2002 03:51:17 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

Mathematica seems to have some limitations dealing with colors, and I was
wondering if there are any workarounds or solutions to these problems.

First, I am having a hard time getting my color output to display in the
colors I specify.  I am trying to make three dimensional plots which heavily
involve color and require the output to be freely rotated to make sense of
the image.  The RealTime3D package does not obey the colors I give under
Mathematica 4.0 (under Windows). Does anyone know if this has been fixed in
4.1?   I have also tried the MathGL3d OpenGLViewer, but it does not work
either.  Basically what I am doing is creating a field of points, along
these lines:

pts = Table[{Hue[a,b,c],Point[{a,b,c}]},
{a,0,1,0.05},{b,0,1,0.05},{c,0,1,0.05}];
Show[Graphics3D[pts]];

This is the most basic form, however in other plots I am varying the size of
the points and not drawing some of the points.  The Default3D view draws
everything fine, except that I can't rotate it freely.  Yes I can draw
several plots and animate them but it takes a long time and isn't quite the
same - for example, I can't zoom in and out. RealTime3D displays all my
points as black and fixed size.  The OpenGLViewer does not give the right
color to my points, but it seems to get the size ok.  The color is the most
important thing!

The second problem I am having is that there does not seem to be any easy
way to generate a plot where color is based on all the coordinates in the
plot.  As a result of this I have to resort to the above point method.  All
the cases where Mathematica lets you specify color seem to be through the
ColorFunction option, which takes the z value in the plot as the input to
the color function.  This is not acceptable to me, as I need to know at
least the x and y values in order to determine the color (and possibly z as
well).    So for example, to display a color wheel I have to do something
like this:

Show[Graphics[{
        Table[{Hue[a/(2 Pi), 1, r], Point[N[{r*Sin[a], r*Cos[a]}]]}, {a, 0,
            2 Pi, Pi/256}, {r, 0, 1, 0.01}]
        }
      ]];

This takes too long and even with all these points still does not fill in
all the points in the circle.

I have tried converting hues and rgb colors to flat integers, but then I
wind up with 3D shapes that I am not sure how to generate - for example, in
one case I appear to need the formula for something resembling an
exponential spiral.

Help? :-)

Michael





  • Prev by Date: RE: silly newbie questions
  • Next by Date: Re: Stochastic calculus in Mathematica
  • Previous by thread: Re: RE: Why can't I cut and paste between Mathematica and other applications?
  • Next by thread: RE: Mathematica's color limitations