This section describes some basic data types used by the system, including points, vectors, triangles, colors, and matrices.
typedef struct point { float x, y, z; } Point, Vector; typedef int PointId;
Point DXPt()
| Construct a Point or a Vector with the given coordinates. See DXPt, DXVec. |
These data structures define the interpolation elements of an Object. They refer to points by point identifiers.
typedef struct line { PointId p, q; } Line; typedef struct triangle { PointId p, q, r; } Triangle; typedef struct quadrilateral { PointId p, q, r, s; } Quadrilateral; typedef struct tetrahedron { PointId p, q, r, s; } Tetrahedron; typedef struct cube { PointId p, q, r, s, t, u, v, w; } Cube;Figure 9 shows the order of vertices in each structure. For more information about connections and the order of vertices, see Chapter 3. "Understanding the Data Model" in IBM Visualization Data Explorer User's Guide.
Figure 9. Order of
Vertices in Connection Elements. In the tetrahedron at right,
s is the point nearest the viewer; in the tetrahedron
at center, the point furthest from the viewer.
Line DXLn()
| Construct a line, triangle, quadrilateral, and tetrahedron respectively, given the appropriate point identifiers. See DXLn, DXTri, DXQuad, DXTetra. |
Colors define the photometric characteristics of an Object; they may be associated with points, triangles, or lights, and may be used to define its reflectance or opacity. In Data Explorer, colors are floating-point numbers and therefore open ended, as is light intensity in the real world. However, real output devices can display only a limited range of intensities. In general, the range from 0.0 to 1.0 is by default mapped onto the range of displayable intensities of the output device, so colors should normally be specified in this range. Data Explorer provides a routine that constructs an RGB color structure.
typedef struct rgbcolor { float r, g, b; } RGBColor;
RGBColor DXRGB() | Constructs an RGB color structure with the given components. See DXRGB. |
Error DXColorNameToRGB() | Gets the RGB values for a specified colorname string. See DXColorNameToRGB. |
Angles are expressed as floating-point numbers in radians. The following macros express angles in units that might be more convenient. For example, 5*DEG is 5 degrees in radians.
typedef double Angle; #define DEG (6.283185307179586476925287/360) #define RAD (1)
Transformation matrices (or transforms) specify the relationship between Objects. For example, when a renderable object is included in a model, a transformation matrix specifies its placement. In Data Explorer, a transform is a 4×3 matrix specifying rotation and translation. This is a homogeneous matrix without the part that computes the w component of the result. (The w component is used for perspective, which is specified by a camera and is not needed here.)
typedef struct matrix { /* xA + b */ float A[3][3]; float b[3]; } Matrix; static Matrix mdentity = { 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 };
Transforms can be specified in a number of ways:
Matrix DXRotateX()
| Return a Matrix that specifies a rotation (in radians) about the x, y or z axis by angle angle. See DXRotateX, DXRotateY, DXRotateZ, DXScale, DXTranslate, DXMat. |
Matrix DXScale() | Returns a Matrix that specifies a scaling by amounts x, y, and z along the x, y and z axes. See DXRotateX, DXRotateY, DXRotateZ, DXScale, DXTranslate, DXMat. |
Matrix DXTranslate() | Returns a Matrix that specifies a translation by vector v. See DXRotateX, DXRotateY, DXRotateZ, DXScale, DXTranslate, DXMat. |
Matrix DXMat() | Returns a Matrix with the specified components. See DXRotateX, DXRotateY, DXRotateZ, DXScale, DXTranslate, DXMat. |
A number of basic operations on the Matrix, Point, and Vector types are defined here. Operations declared as operating on type Vector also work on Point because both are type-defined for structure. These operations all take their arguments by value and return the result.
Vector DXNeg()
| Perform unary operations of negation, normalization, and length. See DXAdd, DXCross, DXDiv, DXDot, DXLength, DXMax, DXMin, DXMul, DXNeg, DXNormalize, DXSub. |
Vector DXAdd()
| Perform vector operations of addition, subtraction, min, and max. Min and max operations are performed on each component of a vector. See DXAdd, DXCross, DXDiv, DXDot, DXLength, DXMax, DXMin, DXMul, DXNeg, DXNormalize, DXSub. |
Vector DXMul();
| Multiply or divide a vector by a floating-point number. See DXAdd, DXCross, DXDiv, DXDot, DXLength, DXMax, DXMin, DXMul, DXNeg, DXNormalize, DXSub. |
float DXDot()
| Form the dot product or cross-product of two vectors. See DXAdd, DXCross, DXDiv, DXDot, DXLength, DXMax, DXMin, DXMul, DXNeg, DXNormalize, DXSub. |
Matrix DXConcatenate() | Returns a Matrix equivalent to the concatenation of two matrices. See DXConcatenate, DXInvert, DXTranspose, DXAdjointTranspose, DXDeterminant, DXApply. |
Matrix DXInvert()
| Compute, respectively, the inverse, transpose, adjoint transpose, and determinant of a matrix. See DXConcatenate, DXInvert, DXTranspose, DXAdjointTranspose, DXDeterminant, DXApply. |
Vector DXApply() | Forms the product of a vector (interpreted as a row vector) and a matrix. See DXConcatenate, DXInvert, DXTranspose, DXAdjointTranspose, DXDeterminant, DXApply. |