This applet animates juggling patterns that are given to it in the
popular
siteswap 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.)
There are actually two separate applets here which can be included in a web page:
JuggleAnimApplet
, formerly called just JuggleAnim
.
This applet animates a pattern on the screen, but the pattern cannot be
interactively changed -- there are no controls other than clicking to pause.
PatternViewerApplet
, which can be configured to contain any or
all of the following elements: An animation view, a pattern input text field,
a pattern browser list, and a siteswap generator. Animation can either be sent to
an attached panel, to a single animation window, or to multiple windows at once.
JuggleAnimWindow.class
, type the JuggleAnimApplet
"input" parameter on the command line (no spaces)
PatternViewerWindow.class
, type the PatternViewerApplet
"input" parameter on the command line (no spaces)
siteswapGenerator.class
, use no command line options to get a
help message
The JuggleAnimApplet
checks for a single input parameter, called
(appropriately enough) input
. This input string is comprised of
a series of semicolon-separated settings in the form
variable=setting
.
There are just two required
settings: one indicating a mode, the other indicating the pattern to animate.
Thus you can put the siteswap 552
into your web page using the
following snippet of HTML:
< APPLET codebase=classes code=JuggleAnimApplet.class width=200 height=250 > < PARAM name=input value="mode=siteswap;pattern=552" > < /APPLET >That's all there is to it. Additional optional settings allow you to tailor the animation, if you want. The allowed settings are described here:
mode
siteswap
or syncsiteswap
. No default.
pattern
border
slowdown
fps
startpaused
dbuffer
g
tps
throwx
rightthrowx
throwx
above. Default is 0.25. (optional)
leftthrowx
catchx
rightcatchx
catchx
above. Default is 0.5. (optional)
leftcatchx
balldiam
bouncefrac
handscoop
dwell
mat_HR
tps
setting above; use tps
instead. No default.
(optional)
mat_DR
dwell
setting above and should normally not be used. No default.
(optional)
mat_style
catchx
and throwx
parameters listed above are overridden (ignored). See below for a description of this
format. No default. (optional)
The applet uses regular siteswap
juggling notation for its input, with a few caveats:
This setting allows you to specify the coordinates of each catch and throw within
the plane of juggling. Imagine a coordinate system with the x axis going from
left to right in front of you (positive direction is to your right), and y axis
going up and down (positive is up). Ken uses the following units of measurement:
each grid tick along the x axis is 2.5 centimeters, and each on the y axis
is 5 cm. The origin is at "normal" catching height, at the centerline of your body.
The setting consists of a string of coordinate pairs in the form
For example, Ken's standard style for the 3 ball cascade is
This applet looks for two parameters, named The other applet parameter is named The format of the pattern files is very simple: Each line is a separate pattern, and
consists of an arbitrary-length label followed by one or more TAB characters, followed by
instructions to be sent to the animator when the item is clicked. If there is no second field
(after the tab), then the label still shows up in the listing but it is inactive.
The "pattern" Setting Format
syncsiteswap
mode.
B
F
The "mat_style" Setting Format
{catchx,catchy}{throwx,throwy}
where each pair is assigned to a throw in the siteswap pattern. If a pair corresponds
to a left-handed throw, the catchx
and throwx
values are
automatically negated. Also, the number of pairs specified need not be equal to the
number of throws in the siteswap -- it just loops back to the beginning when it gets to
the end of the pairs.
{13,0}{4,0}
, which means to catch at 13*2.5 = 32.5 cm from the centerline
(at no elevation) and throw at 4*2.5 = 10 cm from the centerline (also at no elevation).
His version of Mills Mess is {-1,0}{-12,0}{0,0}{12,0}{1,0}{-12,0}
if
you care to puzzle that one out.
PatternViewerApplet Calling Syntax
input
and
patternfile
. As was the case for the applet above, the input
parameter is comprised of semicolon-separated settings. Here, though, the list of
possibilities is shorter:
animator
none
(no animator), panel
(animate in a panel attached to
the pattern viewer), window
(animate in a single window), and
multiplewindows
(more than one animation at a time). The default is
none
. (optional)
generator
siteswap
.
(Actually the generators are dynamically loaded, so if you wrote your own you could
use it instead. When you specify generator=filename
, the applet looks
for a class file filenameGenerator.class
and loads it.) The default is
no generator. (optional)
editor
JuggleAnimApplet
"input" parameter.
The default value depends on the choices of animator
and whether you are
viewing a pattern file (see below). (optional)
patternfile
and is optional. By specifying
a filename as the value of this parameter, you are telling the applet to load the file
and display its contents. Clicking on a listed pattern animates it. The filename should
be specified as a path relative to the HTML file containing the < APPLET >
tag.
Back to the JuggleAnim page