Exposition on MAS964 PS9

A few exercises in design, problem set 9 for Principles of Visual Design.

This was kind of an odd assignment. "Randomness" has been something of a sticking point in our class. I don't really know what the big deal is: pseudorandom number streams are just part of computation, and if you are careful you can use them nicely in a design. Anyway, this assignment was aimed at trying to get us to think about random number generators.

Part of the assignment was to implement our own random number sources. I do this stuff for real as part of my research (simulation and cryptography), so it was hard to be creative about it. I ended up with a couple of Additive Congruential Generators:

  X_n = X_(n-r) + X_(n-s) mod m
with some atypical seeds (the time the program was started squared or cubed, and times of mouse events). The neat thing about this is how much history is stored in the generator.

As for the designs, I'm actually happiest with the simplest first one, just the portrayal of random numbers. I stole the font bitmap from somewhere and wrote a bit of code to render it, that was fun. And the little guide marks in the middle top and bottom are really important in the design. Amazing what a few pixels can do.

The flashy colour applet shows you how one should not use random numbers. I knew that already, but it's nice to see the effect. Random numbers set the hue, saturation, and brightness for each half. Ick! The other colour applet tries to be more subtle - changes aren't abrupt, and each side tries to look something like the other side's colour. I'm not sure how effective this really is.

Sources

ACG.java
Additive Congruential generator. Not too good for serious work, but it's fine for here.
NumberFont.java
Arbitrary bitmap font support for Java, albeit only for the numbers 0 to 9.
FixedNumberFont.java
This restricts the number font to fixed width fonts and renders out numbers to be always width 3. Not very general purpose, but just what I needed here.
DoubleBufferApplet.java
Yay.
RandomApplet.java
Base class of random number things. Handles mouse input, rendering the font rectangles, etc. Note the sychronization between keyDown and redrawImage.
RandomNumbers.java
Draws just numbers and the little index marks.
RandomPanels.java
Draws random colours. I had to draw 3 rectangles so as to avoid drawing under the font rectangles and causing flashies. Having the update of the window happen asynchronously is awkward.
NicePanels.java
Modified from above, the colours move slowly to their new random values. I think this could be tuned better.

Nelson Minar <nelson@media.mit.edu>
Last modified: Fri Apr 25 02:35:44 EDT 1997