intro   modes   commands   objects   attributes   parameters   timing   variables, constants   forces   todo


Parameters

contents

position
axis
color
flag
speed
vary
loop|pingpong


Parameters that return values (for example <flag>, loop, and pingpong) may be used to assign value to a variable. In the case of <flag> the assignment comes from the attribute itself. A returning flag value is always 1 or 0 even though a flag can be set or reset by 'true', yes, FALSE, on, 0, etc.


position

Position is usually given as an xyz triplet of values, however a single coordinate may be named (e.g. z=32) and one, two or three of them supplied. The named variant is especially powerful in that it allows relative positions to be easily given (e.g. y+=5) which is incredibly powerful (e.g. x*=firstpos-wall/avatarheight).

Position may also use polar coordinate systems: distance and angle about one or two axes.

Position can also use a gradient system of distance and gradient in two planes.


axis

Direction, called axis, may be given in various forms: - an angle within a plane, measured from the first axis named on that plane (e.g. zy=4.5 points in the direction of an angle in the zy plane 4.5 radians from the z=0 direction)
- two angle-plane pairs (e.g. yx=0.2 yz 1.5)
- a line with start-point implied as the origin (0 0 0) and only the end-point given.
- a line expressed as 2 points


color

(red green blue alpha filter)

Most common colors will be predefined in library files and may be used instead of complicated descriptions.
Example:
    color Red
    color DeepSeaGreen
    color Orange
    color BrownGlass

Colors can be given a number of ways:

A simple list of numbers will be interpreted in rgbaf order, but this doesn't lend itself to easy reading.
Example:
    color 1 0.2 0.5 0.4 0

Individual parameters may be named.
Example:
    color r=0.5 a=0.7

Additive color mixing is easy to understand, but subtractive mixing is slightly more complicated. Filter is a way of using subtractive color.

Additively mixing all the colors results in white. Subtracting all the colors results in black.


flag

This is essentially an on/off condition. It can receive signals to activate or inactivate the attribute that owns it, but often it also sends a signal if required.

It can use many different ways to show on or off:

on and off in any variation of capitalisation and with or without quotes (on and off are predefined variables that already contain the strings 'on' and 'off' respectively).

true and false (similar situation as for on/off)

1 and 0 as numbers or strings (actually any number other than 0 means on)

yes and no (similar situation as for on/off)

Any mixing of these works. The one attribute can be turned on with 'on' then switched off with 0 then back on with true then off again with 'no'.

When a flag returns a value it is always either 0 or 1 no matter what was used to set or reset it.


speed

This is measured in units per second, where the units are of length and angle.


vary

This is specified in the form of a curve.

This can be a simple table where time is a constant with each item in the list representing a fixed unit of time passing. The value of each item represents the speed at that time. Said like that it sounds complicated but it isn't at all. Imagine a movement that starts slowly, gathers speed, then slows to a stop. The curve is a simple sine wave and can be represented roughly by the list 0 .2 .5 .8 1 .8 .5 .2 0. We will almost never need mathematical accuracy -- in most cases close enough will be good enough.

A curve can also be defined by a formula like sin(n), but this has a lot more overhead and such accuracy will not needed except in rare cases. (I am not sure how the formula limits are to be defined... that will need to be considered.)

It is useful to keep the curve in the range 0 to 1 (though not necessary). This makes curves interchangeable. The curve is multiplied by the speed parameter.

Vary defaults to sine (slow start - fast middle - slow stop) if the keyword is given without a curve. If vary is omitted then constant, unvarying speed is used.


loop and pingpong



intro   modes   commands   objects   attributes   parameters   timing   variables, constants   forces   todo

Maintained by Miriam English