I think it would be good to have a tool, or tools,
for drawing rainbows.

For the primary rainbow, the inside angle is 80 degrees
total (40+40) and the outside angle is 84 degrees. If we
assume that a tuxpaint canvas has a 70-degree vertical
field of view, same as used for popular FPS games, the
rainbow size in pixels is determined.

One might wish to draw a partial rainbow, and one might
wish to place the horizon anywhere. So, trouble...

The interface that comes to mind is that the user does
a click-and-drag with rubber band effect to see where
the rainbow will go. Constrain the second point to be
within the diameter of the rainbow and not directly
above or below the first point. Then there are exactly
two circles passing through the two points, each divided
into two arcs by the points. Eliminate the arcs that have
an upside-down portion. This leaves one arc to be rendered
as the rainbow.

The next problem is endpoint treatment. They can be cut
horizontally, but that is no good near the edges of the
screen. Fading out is an option. Fading out is especially
useful for realistic (as opposed to cartoon-like) rainbows.

Cartoon-like rainbows have nicely distinct colors. In some
ways though, they propagate a lie about how rainbows look.

Realistic rainbows are beautiful and educational, but can
be trouble. Going from inside to outside, you get:

a. a bright area
b. blue to red (40 to 42 degrees) bright primary bow
c. a dark area
d. red to blue (50 to 53 degrees) dim secondary bow
e. slightly bright area

When the Sun is low, you only see the yellow-red part.
When the raindrops are big, the top is missing. (the
drops are no longer spherical) When the drops are small,
you get green and magenta bands just inside the primary
bow. (caused by interference effects)

I have the data I need to produce this. The problem of
course is that the whole screen must be updated in order
to get the light areas ("a" and "e") right. This pretty
much means that usage must be:

1. draw the background (sky,clouds,airplanes...)
2. add the rainbow
3. draw the foreground

Thoughts?

BTW, something involving spline paths also comes to mind.
See the Inkscape "write your name" example in the tutorial,
and imagine a rainbow rendered along the path. It wouldn't
have the correct shape and size, but might be useful for art.
(it's messy and near-useless for teaching about rainbows)




_______________________________________________
Tuxpaint-dev mailing list
[EMAIL PROTECTED]
http://tux4kids.net/mailman/listinfo/tuxpaint-dev

Reply via email to