A Numerical Utility Displaying Ellipsoid Solids
Don Herbison-Evans ,
 Central Queensland University, Bundaberg.

 Beryl: a NUDES ballerina, in 3D, as a Hybrid Wallpaper Autostereogram.
 NUDES allows a user to manipulate a set of ellipsoids for which various actions can be performed, each distributed over specified sets of frames. Groups of ellipsoids may be linked togther to form figures. NUDES scripts are written in a formal language which allows the definition of the figures and their required actions.
 The language allows the whole scene or individual figures can be translated and rotated. The figures can also be bent at any joint, thus allowing articulation. The whole scene, single figures, or individual ellipsoids can be scaled in size along each of the axes separately. Additionally an ellipsoid can be scaled in size thus moving all the other ellipsoids connected to it except for those connected through a nominated joint. The scene or a figure can be positioned so that the lowest point just touches the ground.
 All variables are global. The spacing of items is free, providing there is at least one space between items. Data may be documented by inserting text between an * and the end of a line. Various levels of echoing and diagnostics can be produced.
 The frame numbers must be integers in the range 0 to 32767. The earliest frame number is assumed to be 0, and is notional only, and that frame is not drawn. Where more than one action occurs between a given pair of frames, they are performed in the order in which the respective commands are presented.
 Sequences of actions can be defined and called as subroutines. Frame numbers in subroutines are only internal and purely relative, with actual numbers supplied in the call.
 Units :- the frame is 1000 units wide: the height depends on the output device. Angles are in degrees measured anticlockwise about a rotation axis looking from the origin toward plus infinity along that axis.
     x axis: left to right.
     y axis: up.
     z axis: away from observer.
 Keywords may be abbreviated arbitrarily provided no ambiguity results. Keywords may not be used for names.
 The NUDES suite was developed using public finance, and so the source codes are hereby made freely publicly available. The programs are all in C or C++.

 Frank and Gloria, a NUDES ballroom couple,
 dancing the Merrilyn (a New Vogue sequence dance)


     (nudesscript) = (declarations) (movements) (stop)
   where (declarations) =
   where (declaration) =
     debug   (integer)
     speed   (multiplier)
     view    (framestart) (framestop)
     figure  (figurename) (ellipsoidcount) (ellipsoidnamelist)
     ellips  (ellipsoidname) (xvalue) (yvalue) (zvalue)
     joint   (jointname) (ellipsoidname) (xvalue) (yvalue) (zvalue)
                      (ellipsoidname) (xvalue) (yvalue) (zvalue)
     limit   (jointname)   (xvalue) (yvalue) (zvalue)
     variab  (variablecount) (variablenamelist)
     subrou  (subroutinename)
     endsub  (subroutinename)
   where (movements) =
   where (movement) =
     call    (framestart) (framestop) (sname)
     repeat  (framestart) (framestop) (action)
     linear  (framestart) (framestop) (action)
     quadra  (framestart) (framestop) (action)
     accele  (framestart) (framestop) (action)
     decele  (framestart) (framestop) (action)
     cubic   (framestart) (framestop) (action)
   where (action) =
     debug   (level)
     call    (sname)
     colour  (ename) (redvalue) (greenvalue) (bluevalue)
     textur  (ename) (iname)   (xoffset) (yoffset)
     grofig  (fname) (ename)   (xfactor) (yfactor) (zfactor)
     groell  (ename) (xfactor) (yfactor) (zfactor)
     grojnt  (ename) (jname)   (xfactor) (yfactor) (zfactor)
     movjnt  (jname) (ename)   (x) (y) (z)
     moveto  (fname) (ename)   (x) (y) (z)
     moveby  (fname) (referenceellipsoid) (x) (y) (z)
     ground  (fname)
     spinto  (fname) (ename) (referenceellipsoid)
                     (colatitude) (longditude) (twist)
     spinby  (fname) (ename) (referenceellipsoid) (angle) (axis)
     bendto  (movingellipsoid) (jname) (referenceellipsoid)
                               (colatitude) (longditude) (twist)
     bendby  (movingellipsoid) (jname) (referenceellipsoid)
                               (angle) (axis)
     flex    (movingellipsoid) (jname) (angle)
     rotate  (movingellipsoid) (jname) (angle)
     abduct  (movingellipsoid) (jname) (angle)
     drag    (ename) (movingellipsoid) (jname)
                               (referenceellipsoid) (axis)
     touch   (mvell) (stillell) (movingellipsoid) (referenceellipsoid) (jname) (axis)
     balanc  (movingellipsoid) (jname) (referenceellipsoid) (axis)
     detach  (movingellipsoid) (jname) (fname)
     attach  (ename)           (jname) (ename) (x) (y) (z)
     set     (variablename) (anything)
     invert  (variablename)
     negate  (variablename)
     add     (variablename) (x) (x)
     subtra  (variablename) (x) (x)
     multip  (variablename) (x) (x)
     divide  (variablename) (x) (x)
     angles  (ename) (referenceellipsoid)
                  (variablename) (variablename) (variablename)
     centre  (ename) (variablename) (variablename) (variablename)
     axes    (ename) (variablename) (variablename) (variablename)
     linkx   (jname) (variablename) (variablename) (variablename)
     observe (angle) (angle) (angle)
     place   (x) (y) (z)
     write   (fname)
     print   (variablename)
   where (ellipsoidnamelist) =
     (ellipsoidname) (ellipsoidnamelist)
   where (subroutinenamelist) =
     (subroutinename) (subroutinenamelist)
   where (variablenamelist) =
     (variablename) (variablenamelist)
   where (x),(y),(z),(angle),
     (xoffset),(yoffset) =
   where  (framestart),(framestop) =
   where  (positiveinteger) =
   where  (level),(multiplier) =
   where  (integer) =
   where  (value),(xvalue),(yvalue),(zvalue) =
   where  (fname) =
   where  (ename),(stillell),(mvell),
       (movingellipsoid),(referenceellipsoid) =
   where   (iname) =
   where   (jname) =
   where  (sname) =
   where  (prefix) =
     (non-space character)
   where  (oldfigurename),(newfigurename),
       (variablename),(imagename) =
     (up to 6 non-space characters)
   where (axis) =
   where (anything) =
   where (stop) =
Frame 23 of jocke.n
 (written 11 August 1995, updated 4 June 2014)


      key  no        description
    debug  22 - set debug parameter to given value
    speed  30 - delete or interpolate extra frames
    view   33 - set range of frames actually to be drawn
    figure  1 - declare ellipsoids that compose given figure
    ellips  2 - declare semi-axis lengths of given ellipsoid
    joint   3 - declare position of given joint
    limit  54 - declare angle limits on joint movements
    variab 32 - declare names of variables
    repeat 23 - do the given action at each frame in given range
    linear 25 - generate action over given frames at constant rate
    quadra 24 - generate given action accelerating then decelerating
                to rest quadratically
    cubic  46 - generate given action accelerating then decelerating
                to rest cubically
    accele  5 - generate action linearly accelerating from rest
    decele 10 - generate action linearly decelerating to rest
    linkx  49 - store coordinates of a joint
    axes   48 - store semiaxis lengths of an ellipsoid
    angles 36 - store the current orientation angles of an ellipsoid
    centre 37 - store current coordinates of centre of an ellipsoid
    subrou  6 - start a subroutine definition
    end    29 - end of subroutine or main program
    call   28 - call a subroutine
    stop   16 - no more commands after this
    colour 50 - colour the named ellipsoid the red, green,
                blue coordinates given
    textur 52 - map given image file onto ellipsoid named
    print  51 - print value of given variable
    ground 18 - make lowest point of given figure touch ground plane
    grofig 11 - scale given figure about centre of given
                ellipsoid, multiplying all parts of figure
                by given factor
    groell 34 - scale a single ellipsoid in size keeping all
                joints fixed
    grojnt 35 - scale a single ellipsoid in size keeping a
                nominated joint of it fixed, and allowing its
                centre, other joints and connected ellipsoids
                to move appropriately
    moveby 13 - move given figure by given amounts parallel to
                the axes of given reference ellipsoid
    moveto 27 - move given figure so that centre of given
                ellipsoid is at given position
    movjnt 56 - move a joint relative to the centre of an
    spinby 17 - spin given figure about centre of given ellipsoid,
                rotating by given angle about given axis in given
                reference ellipsoid
    spinto 12 - spin given figure about centre of given ellipsoid,
                rotating given ellipsoid to given angles relative
                to axes in given reference ellipsoid
    bendby 19 - bend figure by given angle about given axis in
                given reference ellipsoid at given joint,
                rotating the given moving ellipsoid and all
                those joined to it
    bendto 21 - bend figure at given joint, rotating given
                ellipsoid to given angles relative to axes in
                given reference ellipsoid
    flex   38 - bend given joint about x axis
    rotate 39 - bend given joint about y axis inwards
    abduct 40 - bend given joint about z axis away from body
    drag   53 - bend second (moving) ellipsoid at given joint about
                its given axis so that first ellipsoid
                touches the ground, while ensuring that the rest
                of the figure is grounded also
    touch  15 - make first ellipsoid touch the second ellipsoid
                by bending the third ellipsoid at the given joint
                about the given axis of the third ellipsoid.
    abut   55 - make ellipsoid1 touch ellipsoid2 by moving its
                figure parallel to given axis of ellipsoid3
    balanc  7 - bend at given joint about given axis of reference
                ellipsoid to balance the moving set of ellipsoids
                with respect to y axis gravity
    set    20 - set a value to a named variable
    invert 31 - divide 1 by value
    negate 41 - negate the value of a named variable
    add    14 - add two variables or values to give a variable
    subtra 42 - subtract second value from first to give a variable
    multip 44 - multiply two values to give a variable
    divide 43 - divide second value into first to give a variable
    attach  8 - join 2 figures at the point on the second
                ellipsoid which is shifted from its centre
                by the given coordinates
    detach  9 - break a figure into 2 at given joint, naming
                the figure containing the given ellipsoid by
                the given name, and keeping the old figure name
                for the other part of the old figure
    observ 26 - set eulerian angles of direction of observer
    place  47 - set centre of view of observer
 Three dimensional interactive animation of scenes composed of ellipsoids using NUDES are obtained using the program LINTEL, which allows to user interactively vary the animation speed runnning forward or backward or just stop, and also to rotate, shift and scale the scene. The interactive commands are single keyboard characters:
          a - animate: default (opp. of 'i')
          b - if frozen, go back one frame else run backwards (opp. of 'f')
          c - continue through restart at full rate (opp. of 'p')
          d - shift down 1% (opp. of 'u')
          f - if frozen, show next forward frame else run forwards (opp.of 'b')
          g - grow scene by 10% (opp. of 's')
          h - show these instructions
          i - freeze (opp. of 'a')
          j - double the number of polygons per sphere {opp. of 'k')
          k - halve the number of polygons per sphere {opp. of 'j')
          l - shift scene left 1% (opp. of 'r')
          n - display of frame numbers (opp. of 'o')
          o - do not display frame numbers (opp. of 'n')
          p - pause on first and last frames: default (opp. of 'c')
          q - quit
          r - shift scene right 1% (opp. of 'l')
          s - shrink scene by 10% (opp. of 'g')
          t - shift scene away by 10 (opp. of 'T')
          u - shift up 1% (opp. of 'd')
          v - shift away (opp. of 'w')
          w - shift nearer (opp. of 'v')
          x - rotate 3 degrees about x (left - right) axis (opp. of '1')
          y - rotate 3 degrees about y (vertical) axis (opp. of '2')
          z - rotate 3 degrees about z (front - back) axis  (opp. of '3')
          0 - reset parameters to default values and freeze at start
          - - delay more between frames
          = - delay less between frames

 The NUDES sub-programs composing LINTEL are: -
  anaglyphe.c - create an anaglyph (red/green) sequence;
compln.c - produce NUDES.4 command file from analysis of a NUDES.n script;
 frad3c.c - add frame numbers to NUDES.3 ellipsoid file;
 hideo.c - project ellipsoids to ellipses, removing hidden lines;
 juxte.c - juxtapose left and right ppm sequences;
 lentic.c - interlace left and right ppm images for lenticular film overlay;
 nudes.c - main NUDES driving program under UNIX;
 plotelg.c - produce postscript file from ellipse outlines;
 prfrmerr - error messages for prfrmv;
 prfrm.c - make a NUDES.3 ellipsoid file from a NUDES.4 command file;
 prplb.c - draw lines on alphanumeric output device;
 raselr.c - produce ppm file of shaded image(s) of ellipsoids;
 rasts.c - produce ppm file from a primitive postscript file;
 shadoq.c - add shadow ellipsoids to a NUDES.3 ellipsoid file;
 split3e.c - break a multiframe NUDES.3 ellipsoid file into many: one per frame;
 stereo6.c - create autostereogram ppm image(s);
 twista.c - make left and right NUDES scripts;
 viewc.c - apply viewing parameters;
 visig.c - project ellipsoids to give ellipse outlines;

 George (the NUDES gorilla) and Kenneth (the NUDES kangaroo) at play.
 Beryl.n - a ballerina (93 ellipsoids)
Gaina.n - an abbreviated ballerina (25 ellipsoids)
Frank.n - a bloke (89 ellipsoids)
Fred.n - an abbreviated bloke (22 ellipsoids)
Gloria.n - a sophisticated lady (94 ellipsoids)
Ginger.n - a less sophisticated lady (29 ellipsoids)
George.n - George Gorilla on a skateboard (32 frames)
Kenneth.n - Kenneth Kangaroo jumping (30 ellipsoids, 120 frames)
  beauty.n - Gaina and George doing a little Pas-De-Deux (512 frames)
chol.n - the cholestane molecule skeleton (41 ellipsoids)
cono26.n - the hexanitro-cobaltic anion breathing (37 ellipsoids, 64 frames)
duet.n - Gaina and Fred doing a little Pas-De-Deux (512 frames)
face.n - a face for texture mapping onto a head (17 ellipsoids, 1 frame)
flamingo.n - Freda Flamingo paddling in a lake (19 ellipsoids)
fouetteb.n - Beryl doing a fouette-en-tournant (32 frames)
 garg.n - a gargoyle on Sydney University tower peering, etc. (75 ellipsoids, 36 frames)
hapkido.n - 2 Freds having a Hap-Ki-Do fight (22 frames)
jocke.n - horse and jockey galloping past a fence (83 ellipsoids, 77 frames)
juggle.n - 2 hands juggling 3 batons (59 ellipsoids, 130 frames)
merr.n - Frank and Gloria dancing the Merrilyn on a dance floor (217 ellipsoids, 767 frames)
metab.n - Cathy Caterpillar becoming Bertha Butterfly (61 ellipsoids, 1075 frames)
plane.n - a simple aeroplane landing (13 ellipsoids, 110 frames)
rev.n - Fred and Ginger doing 3 Waltz reverse turns (253 frames)
 room.n - a dance floor (35 ellipsoids)
rumba.n - Ginger performing the Rumba basic step (97 frames)
 sault.n - Fred doing a somersault (200 frames)
stage.n - a proscenium stage (4 ellipsoids)
uf6e.n - 2 UF6 molecules vibrating and turning (26 ellipsoids, 32 frames)
walk.n - Fred taking 4 walking steps (49 frames)
   21 Sep 2005 lintel27- able to run .n files also
   17 Sep 2005 lintel26- drag limited to high ankle position
    2 May 2005 drawel43- deleted input summary printout
   26 Apr 2005 drawel42- adding compl
   26 Apr 2005 drawel41- adding shadows
   25 Apr 2005 complu- fix view command
   25 Apr 2005 complt- fix final summary
   24 Apr 2005 drawel40- correcting shading
   24 Apr 2005 drawel39- compressing z axis
   23 Apr 2005 drawel38- fixing place/observe error
   20 Apr 2005 compls- change nels to ne
   20 Apr 2005 drawel35- writing errors to standard output
    8 Apr 2005 drawel35- debugging view transform
    7 Apr 2005 drawel34- incorporating movement simulation (prfrm)
    5 Apr 2005 drawel33- incorporating view transform (view)
    4 Apr 2005 drawel32- scale about screen centre
    3 Apr 2005 drawel31- input root of datafile name
   28 Mar 2005 drawel30- improving vertical illumination
   28 Mar 2005 drawel29- improving file name input
   27 Mar 2005 drawel28- file name input
   27 Mar 2005 drawel27- echoed commands
   27 Mar 2005 drawel26- slowed pause, added 'v','w'
   26 Mar 2005 drawel25- fixed shading
   26 Mar 2005 drawel24- fixed visibility of frame numbers
   22 Mar 2005 drawel23- fixed x and y rotations
   22 Mar 2005 drawel- fixed z rotation and help
   22 Mar 2005 drawel- show frame numbers
   22 Mar 2005 drawel- fixed inter-frame delay
   22 Mar 2005 drawel- fixed pausing on first and last frames
   22 Mar 2005 drawel- added single frame forward and back
   21 Mar 2005 drawel- added pause routine
   19 Mar 2005 drawel- separate setels routine.
   13 Mar 2005 drawel- translating to C++ for .NET
    3 Apr 2005 complr- list statistics at end
    1 Apr 2005 complq- read nudes filename root
   29 Mar 2005 complp- rewritten in C++ for .NET 2003
   12 Sep 2003 prfrm- error message contains frame number
   10 Sep 2003 prfrm- touch using nested search
    7 Sep 2003 compl- avoid expanding 0-1 frame period (-e option)
   24 Jul 2003 prfrm- extending drag search angle from 10 to 20 degrees
   16 Jun 2003 prfrm- improving drag
    6 Jun 2003 prfrm- debugging drag
   10 Jan 2003 drawel12- fixing batch flag descriptions
    5 Sep 2002 drawel- making x rotation inwards
    5 Sep 2002 drawel- fixing single frame bug
   16 Jan 2002 viewc- double precision throughout
   22 Nov 2001 drawel- reporting when arrays limit animation length
   28 Sep 2001 drawel- fixing shading to after rotation
   23 Sep 2001 drawel- fixing delay routine
   23 Sep 2001 drawel- delayed double buffer swap
   21 Sep 2001 drawel- fixing CreateWindow bug
   15 Aug 2001 drawel- start with trigonal bipyramids
    1 Aug 2001 drawel- adding variable display slow
   14 Jun 2001 drawel- fixing shading
    7 Jun 2001 drawel- show frame numbers
   24 May 2001 drawel- slowing up
   24 May 2001 drawel- trying for animation
   15 May 2001 drawel- trying to get shading right
    3 May 2001 drawel- getting rotations in right order
    2 May 2001 drawel- enabling hidden surface testing
   24 Mar 2001 drawel- initsphere revised
    7 Mar 2001 drawel- opengl routine names inserted
   24 Jan 2001 drawel- interactive and flag options removed for simplicity.
   17 Aug 2000 drawel- for gl on Viewsonic/Zondata machines.
   23 Apr 1998 drawel- display slow
   17 Apr 1998 drawel- t for translate in z, +/- for slow
   23 Mar 1997 compl- debug information hidden more
   18 Mar 1997 compl- optional warnings
   17 Jul 1996 prfrm- print command to standard error output
    7 Feb 1996 prfrm- clean up dotouch
    3 Feb 1996 prfrm- clear floating exceptions
   19 Aug 1994 prfrm- removed some goto's
   13 Aug 1994 prfrm- cleaning up perfrm
   21 Jul 1994 compl- fixed 'match' bug
   29 Apr 1994 prfrm- cleaning up drag
   28 Apr 1994 compl- variable subroutines permitted
   22 Sep 1993 prfrm- cleaning up after detach fixed up
   10 Sep 1993 drawel- accommodates joint information
   10 Sep 1993 compl- documentation improved
   16 Aug 1993 compl- movjnt added
    2 Aug 1993 viewb- allows joint information
   12 Mar 1993 compl- abut added
   11 Mar 1993 compl- repeated subroutine calls allowed
    4 Mar 1993 compl- keyword 'all' turned into 'every'
   17 Feb 1993 prfrm- touch using Buckdale's algorithm
    4 Feb 1993 prfrm- touch using scanning
   28 Oct 1992 prfrm- joint limits added
   15 Oct 1992 prfrm- viewing transformation separated (view)
   12 Jun 1992 compl- drag added
   17 Apr 1992 prfrm- touch fixed
   26 Feb 1992 drawel- written : for Silicon Graphics Iris
   12 Feb 1992 compl- allow cubic movements
   29 Jul 1991 prfrm- print variable values nicely
   24 Nov 1988 prfrm- more ellipsoids accommodated
    7 Apr 1987 compl- translated to c, copy deleted
   10 Dec 1986 prfrm- translated into c
   29 Nov 1986 prfrm- write figure for Benesh interpreter
   25 Nov 1986 compl- write a complete figure
   17 Oct 1986 prfrm- texturing for ellipsoids
    7 Oct 1986 compl- texture statement added
    8 Mar 1986 compl- print statement added
   21 Jul 1985 compl- ellipsoids declared on the fly
   22 Jun 1985 prfrm- grofig scales about an ellipsoid (Peter Gummer)
   14 Jun 1985 prfrm- spinto added (Peter Gummer)
   15 Apr 1985 prfrm- setels simplified (Peter Gummer)
   12 Apr 1985 compl- simplified subroutine join (Peter Gummer)
    3 Apr 1985 compl- world added, refell for spinby,moveby (Peter Gummer)
    3 Jan 1985 prfrm- attach, detach work properly (Peter Gummer)
   23 May 1984 compl- change parsing order
    7 May 1984 prfrm- multiply, subtract, divide, balance added
   22 Dec 1983 compl- reduced number of constants in val
   14 Dec 1983 compl- variable frame numbers
   12 Dec 1983 prfrm- variable frame numbers
   25 Nov 1983 prfrm- rotations stored as twist about axis
   22 Nov 1983 prfrm- separate error message file
    2 Nov 1983 compl- moved integer codes 11-19 to 21-29 (Danuta Kucharska)
   15 Oct 1983 compl- added 'colour' action (Danuta Kucharska)
   15 Oct 1983 compl- ellipsoid default colour to flesh (Danuta Kucharska)
   16 Aug 1983 compl- work out range of frames
   19 Apr 1983 prfrm- insert axes, link, fix detach, ground
   16 Sep 1982 prfrm- ellipsoid names put in 1st frame
   19 Jul 1982 prfrm- tolerance put in subroutine rotput
   31 Mar 1982 compl- observe, all, par array stored
   26 Mar 1982 prfrm- single precision version for speed
   26 Mar 1982 nudes- move to Digital PDP11/34
    8 Oct 1981 prfrm- make data structure of figure a list
    2 Oct 1981 prfrm- add, attach, detach, flex, extend, etc. added
    1 Oct 1981 compl- add,touch,attach,detach,flex,etc
   28 Sep 1981 compl- declare variables to PMAX
   16 Jul 1981 compl- to negate variables (Nora Neilands)
   16 Jun 1981 compl- to store orientations and positions (Nora Neilands)
   29 May 1980 compl- moved to 64KB PDP11: separate compile and perform
   27 Jul 1979 nudes- groell, grojnt added
   20 Feb 1979 nudes- subroutines added
    1 Apr 1977 nudes- named constants introduced
   17 Jan 1977 nudes- bends use any reference ellipsoid (Bruce McNair)
    4 Jun 1976 nudes- made interpretive
   10 May 1976 nudes- input translation separated from drawing
    1 Apr 1975 nudes- frame numbers used in input language
    1 Apr 1975 nudes- translated in to Fortran for IBM 7040
   28 Oct 1974 nudes- to use optionally the plotter
   24 Sep 1974 nudes- to verbalize the input language
   11 Aug 1973 nudes- translated into Fortran for IBM 7040
   11 Apr 1973 nudes- to allow more than one figure
    1 Dec 1972 nudes- to remove hidden lines 
   11 Aug 1972 nudes- written in Algol for English Electric KDF9