The Data Model (Introduction)

2.1 The "Position" Component
The "positions" Component in DX always contains "vector" data, even if the vectors are one-dimensional. Note that a 1D vector is not the same as a scalar: scalars are dimensionless values; a 1D vector is a distance and direction along a line or axis. So a 1D position of [5] means we've moved 5 units from the origin along the X axis but the scalar value 5 has no direction, just a magnitude. A 2D vector locates a point in a 2D planar space and a 3D vector locates a point in a volumetric space. Computer graphics people and other mathematicians may be appalled at my blurring of the meaning of "vector" and "point," but for the sake of this discussion, consider a spatial position to be the endpoint of a vector based at the spatial coordinate system's origin. Thus, the point [1,2,3] is 1 unit along the positive X axis, 2 up in Y, and 3 out (toward viewer) in Z in the DX coordinate system, as measured from [0,0,0], the origin. The structure that stores an item like [1,2,3] is termed a 3-vector in DX.

 

The square brackets are used within many modules and the DX script language to denote "vector" quantities. The brackets are neither required nor desirable within data files even if you plan to read each set of successive three numbers as a 3-vector. This is handled automatically by the Import modules if you've properly declared the data to be vectorial in your header file.

Although we've talked about the "positions" array in such a way that you may now be worrying that you'll have to write out a zillion [X, Y] pairs, in fact, for regular arrays, DX can use a shorthand description format. For a 2D positions component describing a grid that is 20 positions wide in X and 30 positions high in Y, starting at the point [10, -45.2], in which the X grid deltas are always 2.3 and Y deltas are 0.5, the description needs only to specify origin, delta, and counts in each dimension. In the "native" DX file format, this declaration would look something like the following:

Origin		10 	-45.2
Deltas		2.3 	0.0       // this is the X delta vector
		0.0	0.5       // this is the Y delta vector
Counts	        20	30

Notice that the deltas are themselves vectors and there is one vector for each dimension, in this case, two vectors, each of which is a 2-vector, because we have 2 axes. Why? It turns out to be convenient sometimes to create a regular grid that is "skewed." If we said the X delta was [2.3 1.0], each time we went 2.3 units to the right, we'd also move the point up 1.0 units in Y. Thus, each row line would move to the right and up and the resultant grid would be skewed up and to the right rather than having 90° angles like grid paper. Normally, you'd simply keep the other axes values at 0.0 to maintain an orthogonal grid. (But you can't cut corners and describe the deltas as simply [2.3, 0.5].)