Data Types

There are many different types of data. SDL formalizes the typing of data and provides you with the means to declare and use variables of each type. There are 23 data types. Each data type is discussed briefly, below. Click on the highlighted text to go to the complete description of a particular data type.

Array Data Type

An array is a named group of data items (which do not have names themselves) organized as a fixed number of occurrences (specified). Occurrences are numbered from 0 to n-1. The data items may be of any type (including type array) and need not be similar to other data types in the array.

Camera Data Type

This is equivalent to the definition in the old CAMERA section. Note that this separates the definition of camera attributes from the placement of the camera in the scene. This separation is consistent with satisfying the needs of "camera-as-object". The placement of a camera in the scene amounts to instancing a camera object in the model, and is discussed later. Definition of camera objects also allows multiple cameras, saving of cameras, and so on, although there will normally be no advantage in getting too clever with this.

There is a new .command line option that allows you to override the aspect ratio (for -rn use the float `n' as the aspect ratio). The precedence is to use the command line option if present, use the camera parameter in SDL if present, or use the default value of 1.0. The command line option will only apply to the first camera defined in SDL (in those cases where more than one camera exists). The command line option applies to all images produced by the first camera in the cases of field rendering and/or stereo.

Curve Data Type

A curve is a series of control vertices for some spline curve or surface. Since patches and faces are defined in terms of spline curves, curves are used for their definition. curves are also used for motion paths. curves exist in 3D space (actually homogeneous 4 space).

CV Data Type

A cv is a control vertex for some spline curve or surface. Since patches and faces are defined in terms of spline curves, cvs are used for their definition. cvs are also used for motion paths. cvs exist in 3D space (actually homogeneous 4 space). It is useful to keep cvs in arrays.

Face Data Type

A face is a planar object delimited by a spline curve, possibly with holes.

Filename Data Type

Data of type filename is used for various purposes throughout SDL. Such usage is consistent and does not change. You may define variables of this type and use them in place of any literal usage.

Light Data Type

A light primitive is a source of illumination for a scene.

Motion_curve Data Type

A motion_curveallows you to specify a 3D spline curve to be used for animation. Usually the spline curve is used as a motion path.

Parameter_curve Data Type

A parameter_curve is similar to a curve except it is used for animate curves. It exists in 2D space and carries slope (tangent) information specific to animation.

Parameter_vertex Data Type

A parameter_vertex is similar to a CV except it is used for animate curves. It exists in 2D space and carries slope (tangent) information specific to animation.

Patch Data Type

A patch is a spline surface defined by a 2D array of CVs.

Polyset Data Type

A polyset is a polygonal mesh. It may be instanced as an object in the MODEL section. A polyset may be specified as a literal or as a variable. If specified as a variable, it must have a name.

Scalar Data Type

A scalar is a single numeric value. It is always stored and used as a float, though assigning it to an item that is semantically an integer will perform the implicit cast.

Shader Data Type

A shader description. A shader defines the optical properties of a face or patch.

Texture Data Type

A texture description. A texture is a function that returns information that changes, depending on its inputs.

Transformation Data Type

The current transformation matrix is a set of matrices that are maintained to relate the sense of position, orientation and size between objects and the world coordinate system. While the internal form of these (and their interdependencies) are not available to the user, it is convenient to be able to store, assign and use them. The transformation data type defines variables to store, assign and use a transformation matrix.

Trim_vertex Data Type

A trim_vertexis similar to a cv except it is used for trim curves. It differs only in two respects - the sense of how it is used, and the amount of information associated with it. A trim_vertex specifies information about its relation to the surface being trimmed.

Triple Data Type

A tripleis an ordered triplet of numeric values. That is, a value in some 3 dimensional space. It could be a point in modeling space, a vector or even a color, for example. It is useful to keep the form simple, however, and not worry about the distinctions between different spaces or the attributes of the space and simply allow for 3 dimensional things.

Trim face Data Type

A tf (trim face) is an ordered list of trim boundaries, each boundary of which defines a region of a NURBS surface to be kept or discarded in order to trim a surface.

Trim boundary Data Type

A tb (trim boundary) is an ordered list of trim edges each edge of which is joined circularly to encompass an area of a trimmed patch in parametric space.

Trim edge Data Type

A te (trim edge) is an ordered list of trim b-splines that describes an edge of a trim region on a NURBS surface.

Trim b-spline Data Type

A tbs (trim b-spline) is a monotonic ordered list of trim curve vertices which describe a 2-dimensional spline in the parametric space of the patch.

Trim curve vertex Data Type

A tcv (trim curve vertex) is an ordered list of 4 numbers representing the u,v,w and t coordinates of the spline curve.

Creating Data Items

Declaring Variables

Data is either defined as a literal or as a variable. Variables are declared, and then subsequently referenced. Literals are defined and referenced at the same time. A following section will discuss literals, this section considers variables. All variables are declared in the DEFINITION Section of SDL. That section is the first section in a SDL file, so any declarations made will be before their potential usage in subsequent sections. Variables may be used in the declaration of other variables, however, so some care must be taken that the sequence of declaration is appropriate to such usage. No variable may be referenced before it is declared. All variables have names. Each name must be unique (all names exist in the same name space). The name associated with a variable is given in the declaration of the variable, and may not be changed. Names are formed in the same way and using the same character set as "C". Upper case and lower case are distinguished. Redeclaration of a variable with the same name is an error. There may be no duplicates.

Variables may be declared in any order convenient for the user that satisfies the above requirement that a variable be declared before it is used.

Variables of type other than the Array Data Type always have values associated with them. These values are the default values (see the detailed descriptions) unless some other value has been assigned. Arrays have a special default value which means that no value has been assigned, and which will give a data type casting conflict if any attempt is made to use it. Initial values may be assigned to any variable at the time it is defined.

All variables have a scope from their declaration to the end of the SDL file. They may always be referenced within their scope. Similarly, they persist for the entire rendering.

Specifying Literals

A literal and a variable declaration are similar in syntax. The difference is that a literal is defining a single instance of some data, whereas a declaration is defining a variable to hold data (with an initial value) which may be subsequently referenced arbitrarily. Literals do not have names. Literals are not known outside the context in which they are used. Some data types may not be used in a literal sense. Literals themselves may not be the target of an assignment. However, the specification of a literal may contain references to variables for some of its components and hence change value over time.





aliasdocs@aw.sgi.com
Copyright © 1997, Alias|Wavefront, a Silicon Graphics Company. All rights reserved.