This applet animates juggling patterns that are given to it in the
popular
site swap juggling notation. You give it a pattern string
as well as the physical parameters describing the juggler and his world
(acceleration of gravity in meters/second^2, throws per second, etc.),
and the applet will animate the pattern in as realistic a manner
as possible. By this I mean that, while the pattern is of course scaled
down in size to fit on the screen, the physical aspect ratio of the pattern
as well as the timing of the throws is realistic. (Actually the timing
can be globally scaled using the slowdown
parameter
discussed below, but this doesn't disturb the appearance of the pattern.)
One of my goals when creating this applet (beyond that of learning Java) was to make it as general-purpose as possible. In the near future I will be adding support for bounce juggling and possibly passing. If you think of any nifty features to add, feel free to email me at jboyce@physics.berkeley.edu. I have been thinking about converting my site swap-generating program J2 to Java and teaching it how to talk with the animation applet.
This applet has only been tested by me on a Power Mac, using Sun's JDK 1.0.2 and a beta version of Netscape 3.0. If there are any problems on other machines (or some other Java programmers want to give me some programming tips), please email me with them.
The full form of the applet call is shown below. There are two required parameters: one indicating a mode, the other indicating the pattern to animate. The remaining parameters marked with asterisks are optional, in which case the default values are shown). The line break below just separates the animation parameters from the physical parameters, and is not a necessary part of the calling syntax.
<APPLET codebase=JuggleAnim code=JuggleAnim.class width=150 height=200> <PARAM name = mode value = "siteswap"> <PARAM name = pattern value = "5" > <PARAM name = border value = "0" > * <PARAM name = slowdown value = "1.0" > * <PARAM name = fps value = "10.0" > * <PARAM name = startpaused value = "true" > * <PARAM name = dbuffer value = "true" > * <PARAM name = imagebase value = "" > * <PARAM name = ballpic value = "ball.gif"> * <PARAM name = g value = "9.8" > * <PARAM name = tps value = "4.5" > * <PARAM name = throwx value = "0.25" > * <PARAM name = rightthrowx value = "0.25" > * <PARAM name = leftthrowx value = "-0.25" > * <PARAM name = catchx value = "0.5" > * <PARAM name = rightcatchx value = "0.5" > * <PARAM name = leftcatchx value = "-0.5" > * <PARAM name = balldiam value = "0.1" > * <PARAM name = bouncefrac value = "0.9" > * <PARAM name = handscoop value = "-0.2" > * <PARAM name = dwell value = "1.0" > * </APPLET>
mode
siteswap
or syncsiteswap
.
pattern
border
slowdown
fps
startpaused
dbuffer
imagebase
ballpic
balldiam
parameter below. (optional)
g
tps
throwx
rightthrowx
throwx
above. (optional)
leftthrowx
catchx
rightcatchx
catchx
above. (optional)
leftcatchx
balldiam
ballpic
above. (optional)
bouncefrac
handscoop
dwell
The applet uses regular site swap juggling notation for its input, with a few changes:
syncsiteswap
mode.
B
F
There are three additional parameters that the program looks for; the intended purpose of these is to emulate the pattern input format used by Ken Matsuoka's JuggleMaster program. The problem is that my juggler's hands don't move in quite the same way (particularly when there is a hold), so some patterns look odd. Anyway, if you want to fool around with it the parameters are:
<PARAM name = mat_style value = "{13,0}{4,0}"> * <PARAM name = mat_DR value = "0.5" > * <PARAM name = mat_HR value = "0.2" > *If the
mat_style
parameter is specified (which tells the hands how
to move), then the catchx
and throwx
parameters listed
above are ignored. Similarly, the mat_DR
and mat_HR
override the dwell
and tps
parameters, respectively.
The values shown above are not defaults but just show "common" values. You can
obtain these parameters by looking in the patt_e.jm
file that comes
with JuggleMaster. As an example, look at the
Mills' Mess pattern from JuggleMaster.