Home
About
Screenshots
Download
Documentation
    Overview
    Syntax
    Properties

Ephemeris Syntax

There are three kinds of objects, built-in objects, composite objects, and clone objects.  Built-in objects, such as a Sphere or a LathedObject, may be global objects (although this isn't usually good practice) or sub-objects of a composite object.  The syntax for a built-in object is (propertyList is explained later):
ObjectName propertyList ;
Composite objects are a list of built-in or clone objects (but not other composite objects—no nesting allowed):
object_name { [object object ...] }
Note that object_name must be unique at all times.

A clone object is simply a reference to a composite object, with the same syntax as a built-in object except that ObjectName is the name of the composite object.  If you are familiar with a programming language the composite/clone relationship is the same as that of the function definition/function call relationship.

Example:

composite_obj {
    Sphere position = (1, 0, 0) color = (128, 0, 0);
    Cube texture = "texture/wood.png";
    Cube position = (0, 2, 0) NoDraw;
    }

Scene {
    Sky sun_phi = 90;
    composite_obj color = (0, 0, 128) texture = "texture/marble.jpg";
    }

In this example, Sphere, Cube, and Sky are all built-in objects, composite_obj and Scene are composites, and Scene uses a clone of composite_obj.

Properties

Each object has a list of properties that can, but do not need to be, specified.  A property is of the form
name = value | flag
and the list is a set of properties each separated by whitespace.  Each name has certain types of values that are legal to specify;  the associations will be listed later, but the different types and their syntax are:
 
Number [nnn...n][.nn...n] [%] 10, 3.1415, 50%
Color ( red, green, blue ) (0, 128, 0)  (255, 255, 255)
Vector (ordered triplet) ( x, y, z ) (10, 1.5, 7)
Ordered pair ( x, y ) (1, .5)
String "string here" "sub_obj", "texture/wood.png"
Boolean true | false | yes | no True, FALSE, Yes, no
Object-specific value "value" "{ (1, 0, 0), (2, 0, 0), (3, 0, 0) }"

It is important to note that specific properties (i.e. anything that is not common to all objects) must be treated as a string unless they are numbers or booleans.  So even though the sun_color property of Sky is a color, the property must be written as sun_color = "(100, 200, 5)", with the double-quotes, although sun_phi = 70 does not need double-quotes.

A flag is essentially a property that defaults to false and does not require the = value part.

Miscellaneous

  • Names can contain only alphanumeric characters and underscores and must be 1 - 255 characters long.
  • Whitespace may include the normal characters (space, tab, new line, carraige return).
  • Forward slashes ('/') will be converted to the current platform's directory separator.  This is preferred over the native separator, since native separators will only work on that platform.
  • Supported image types are currently limited to JPEG and PNG.  (JPEGs are not recommended since it is a lossy compression and the artifacts can be extremely noticeable when there are sharp color contrasts)
  • By default, textures are modulated by the color of the object. Thus anything other than white will alter the color of your texture when applied to the object.
  • Unless programmatically set otherwise, the engine starts at (0, 0, 0) facing the -z axis (like OpenGL). In this position, the x-axis is to the right, the y-axis towards the top of the window, and the z-axis coming out of the screen toward the viewer.

Home    About    Screenshots    Download    Documentation

Copyright © 2001 Geoffrey Prewett