The scene description read by rayshade consists of a number of keywords, each followed by a set of arguments. These keywords can be thought of as commands that direct rayshade to do various things, such as create objects, set the eye's position, and change an object's appearance.
Many of the keywords have related command-line options for turning on special features and setting values. These options override the values given in the input file.
Rayshade is ``case sensitive,'' which means that typing SPHERE or Sphere instead of sphere won't work. Rayshade keywords are all lower-case. Many people choose to capitalize the first letter of names that they give to objects or surfaces in order to make then ``stand out'' in an input file.
Keywords, numbers and strings in the input file are separated by spaces, tabs, or new lines (carriage returns). These ``whitespace'' characters are handled identically by rayshade, which means that you can separate keywords from keywords, key words from arguments, and arguments from arguments using any combination of whitespace characters that you choose.
Table: Operators, in order of decreasing precedence
Numbers may be entered directly as reals or as parenthesized expressions. Reals may be written in exponential notation if you wish, and integers may be written with or without a trailing decimal point. When an integer value is called for and a real is given, the real value is truncated and the resulting integer is used. The above table lists the available operators available for use in expressions, in order of decreasing precedence.
The upshot of all this is that the strings 42, 42., (20 + 22), and (7^2 - 7) mean the same thing to rayshade.
Variables may also be defined and used in expressions. Some predefined variables are available. These include pi, dtor (pi/180), and rtod (180/pi). Also some variables for animation are available.
Several built-in functions are provided. These include sin, cos, tan, asin, acos, atan, sqrt, and hypot. Some other built-in functions are also provided for animation.
Rayshade will automatically run the input it receives through the C preprocessor if it is available. This allows you to use C preprocessor directives, such as #include, #define, and #ifdef when designing your input files.
Comments may be included in rayshade input files by enclosing text between the strings /* and */, as in the C programming language.