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.
  • In addition to these applets, the following classes can be run from the command line:
  • 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
  • JuggleAnimApplet Calling Syntax

    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:

    Required Settings

    The animation mode, currently must be set to either siteswap or syncsiteswap. No default.
    Pattern to animate, in either siteswap or sync siteswap notation, depending on the mode setting. No default.

    Animation Settings

    Size of border around juggling pattern, in pixels. Default is 0. (optional)
    Factor by which to slow down time. Default is 1.0, full speed. (optional)
    Frames per second on the screen. Default is 10.0. (optional)
    Should the animation start paused (true/false)? Default is false. (optional)
    Should the animator double-buffer to improve quality, at the expense of increased memory usage (true/false)? Default is true. (optional)

    Physical Settings

    Acceleration of gravity, in meters per second per second. Default is 9.8. (optional)
    Throws per second made by juggler. Default is 4.5. (optional)
    Throwing position from centerline of body for both hands, in meters. Default is 0.25. (optional)
    Throwing position for right hand only, overrides throwx above. Default is 0.25. (optional)
    As above, for the left hand. This will usually be a negative number, in meters. Default is -0.25. (optional)
    Catching position from centerline of body for both hands, in meters. Default is 0.5. (optional)
    Catching position for right hand only, overrides catchx above. Default is 0.5. (optional)
    As above, for the left hand. This will typically be a negative number. Default is -0.5. (optional)
    Ball diameter, in meters. Default is 0.1. (optional)
    Fraction of a ball's energy retained after bouncing off the ground (how much of its dropped height does it return to?). Default is 0.9. (optional)
    Distance in meters below catch/throw position that balls are "scooped" to on the carry. Negative numbers mean to scoop down. Default is -0.2. (optional)
    Time (in units of throws) that a caught ball spends in a hand. A dwell of 1.0 means that each hand is full half the time. Default is 1.0. (optional)
    Ken Matsuoka's "Height Ratio" parameter from his JuggleMaster program, included here for compatibility with his pattern files. This overrides the tps setting above; use tps instead. No default. (optional)
    Ken Matsuoka's "Dwell Ratio" parameter, also included for compatibility. This overrides the dwell setting above and should normally not be used. No default. (optional)
    Supports Ken Matsuoka's "style" settings, which are instructions for moving the hands. If this setting is included then the catchx and throwx parameters listed above are overridden (ignored). See below for a description of this format. No default. (optional)

    The "pattern" Setting Format

    The applet uses regular siteswap juggling notation for its input, with a few caveats:

  • The input is case-sensitive. Lower-case letters are used for throw values ('a'=10, etc.). Upper-case is used for throw modifiers, which come after the throw they modify.

  • A lower-case letter is always a throw value, with the exception of the letter 'x', which denotes crossing throws in syncsiteswap mode.

  • You should not use any spaces in the pattern.

  • There are currently two recognized throw modifiers:
    Lift-bounce the preceding throw. If this is not possible, do a force-bounce instead (you can't lift-bounce 1's when juggling at a normal pace, for example).
    Force-bounce the preceding throw.

    The "mat_style" Setting Format

    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 {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.

    For example, Ken's standard style for the 3 ball cascade is {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

    This applet looks for two parameters, named 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:

    Tells the applet how to animate patterns which are selected. Allowed values are 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)
    Pattern generator to use. Currently the only option is 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)
    Include a single-line pattern input text box (true/false)? If there is a generator loaded all input is sent to it for interpretation before going to the animator. Otherwise, you can either type in siteswap (or sync siteswap) notation, or input directly to the animator in the same format used by the JuggleAnimApplet "input" parameter. The default value depends on the choices of animator and whether you are viewing a pattern file (see below). (optional)

    The other applet parameter is named 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.

    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.

    Back to the JuggleAnim page