Structs



TQ3BoxData


typedef struct TQ3BoxData {
    TQ3Point3D                                  origin;
    TQ3Vector3D                                 orientation;
    TQ3Vector3D                                 majorAxis;
    TQ3Vector3D                                 minorAxis;
    TQ3AttributeSet                             *faceAttributeSet;
    TQ3AttributeSet                             boxAttributeSet;
} TQ3BoxData;
Discussion

Data describing the state of a box object.

Field Descriptions
origin
Origin of the box (one of the corners).
orientation
Orientation vector of the box.
majorAxis
Major axis of the box.
minorAxis
Minor axis of the box.
faceAttributeSet
Array of attribute set objects for the 6 faces. This field may be NULL, or individual sets in the array may be NULL.
boxAttributeSet
Attribute set object holding attributes that apply to all of the faces. May be NULL.

TQ3ConeData


typedef struct TQ3ConeData {
    TQ3Point3D                                  origin;
    TQ3Vector3D                                 orientation;
    TQ3Vector3D                                 majorRadius;
    TQ3Vector3D                                 minorRadius;
    float                                       uMin;
    float                                       uMax;
    float                                       vMin;
    float                                       vMax;
    TQ3EndCap                                   caps;
    TQ3AttributeSet                             interiorAttributeSet;
    TQ3AttributeSet                             faceAttributeSet;
    TQ3AttributeSet                             bottomAttributeSet;
    TQ3AttributeSet                             coneAttributeSet;
} TQ3ConeData;
Discussion

Data describing the state of a cone object. The orientation, major radius, and minor radius vectors need not be orthogonal, though they should be independent. Normally these vectors (in that order) should form a right-handed system. If they form a left-handed system, then the cone is "inside out", i.e., the front face is inside.

The values uMin, uMax, vMin, and vMax allow partial cones, e.g., a cone with a wedge cut out of it or with its tip cut off. This feature was not implemented in QuickDraw 3D. See the discussion of TQ3EllipseData for notes on the interpretation of uMin and uMax.

If vMax < 1, so that the tip is cut off, the top disk is considered part of an interior face, rather than a top cap.

Field Descriptions
origin
The center of the base of the cone.
orientation
Vector from the origin to the tip of the cone.
majorRadius
A vector from the origin to a point on the perimeter of the base.
minorRadius
A vector from the origin to a point on the perimeter of the base.
uMin
Minimum value of the u parameter, which goes around the base. Typically 0.
uMax
Maximum value of the u parameter, which goes around the base. Typically 1.
vMin
Minimum value of the v parameter, which goes from base to tip. Typically 0.
vMax
Minimum value of the v parameter, which goes from base to tip. Typically 1.
caps
End cap masks, determining whether there is a bottom cap, and in the case of partial cones, determining whether there is an interior face.
interiorAttributeSet
Interior attributes. Unused by QD3D.
faceAttributeSet
Attributes that affect the face but not the bottom. May be NULL.
bottomAttributeSet
Attributes that affect the bottom end cap. May be NULL.
coneAttributeSet
Attributes for all parts of the cone. May be NULL.

TQ3CylinderData


typedef struct TQ3CylinderData {
    TQ3Point3D                                  origin;
    TQ3Vector3D                                 orientation;
    TQ3Vector3D                                 majorRadius;
    TQ3Vector3D                                 minorRadius;
    float                                       uMin;
    float                                       uMax;
    float                                       vMin;
    float                                       vMax;
    TQ3EndCap                                   caps;
    TQ3AttributeSet                             interiorAttributeSet;
    TQ3AttributeSet                             topAttributeSet;
    TQ3AttributeSet                             faceAttributeSet;
    TQ3AttributeSet                             bottomAttributeSet;
    TQ3AttributeSet                             cylinderAttributeSet;
} TQ3CylinderData;
Discussion

Data describing the state of a cylinder object. The orientation, major radius, and minor radius vectors need not be orthogonal, though they should be independent. Ordinarily, the vectors (orientation, major axis, minor axis) should form a left-handed coordinate system. If they form a left-handed system, then the cylinder is "inside out", i.e., the front face is inside.

The values uMin, uMax, vMin, and vMax allow partial cylinders, e.g., a cylinder with a wedge cut out of it. This feature was not implemented in QuickDraw 3D. See the discussion of TQ3EllipseData for notes on the interpretation of uMin and uMax.

Field Descriptions
origin
The center of the base of the cylinder.
orientation
Vector from the origin to the center of the opposite end.
majorRadius
A vector from the origin to a point on the perimeter of the base.
minorRadius
A vector from the origin to a point on the perimeter of the base.
uMin
Starting value of the u parameter, which goes around the base counterclockwise. Typically 0.
uMax
Ending value of the u parameter, which goes around the base counterclockwise. Typically 1.
vMin
Minimum value of the v parameter, which goes from the base to the other end. Typically 0.
vMax
Maximum value of the v parameter, which goes from the base to the other end. Typically 1.
caps
End cap masks, determining whether the cylinder is closed on one end, the other, or both.
interiorAttributeSet
Interior attributes. May be NULL. Unused by QD3D.
topAttributeSet
Attributes that affect the top end cap. May be NULL.
faceAttributeSet
Attributes that affect the face but not the bottom or top. May be NULL.
bottomAttributeSet
Attributes that affect the bottom end cap. May be NULL.
cylinderAttributeSet
Attributes for all parts of the cylinder. May be NULL.

TQ3DiskData


typedef struct TQ3DiskData {
    TQ3Point3D                                  origin;
    TQ3Vector3D                                 majorRadius;
    TQ3Vector3D                                 minorRadius;
    float                                       uMin;
    float                                       uMax;
    float                                       vMin;
    float                                       vMax;
    TQ3AttributeSet                             diskAttributeSet;
} TQ3DiskData;
Discussion

Data describing the state of a disk object (a filled ellipse). The major radius and minor radius vectors need not be orthogonal, though they should be independent. The direction of the front face is the cross product of the major and minor axes.

The values uMin, uMax, vMin, and vMax allow partial disks, e.g., a slice of pie (partial range of u values) or a washer (partial range of v values). This feature was never implemented in QuickDraw 3D, although it was planned. See the discussion of TQ3EllipseData for notes on the interpretation of uMin and uMax.

The u and v limits here do not have anything to do with the uv parametrization used by shaders.

Field Descriptions
origin
The center of the disk.
majorRadius
A vector from the origin to a point on the perimeter of the disk.
minorRadius
A vector from the origin to a point on the perimeter of the disk.
uMin
Starting value of the u parameter, which goes around the perimeter counterclockwise. Typically 0, must be in the range [0, 1].
uMax
Ending value of the u parameter, which goes around the perimeter counterclockwise. Typically 1, must be in the range [0, 1].
vMin
Minimum value of the v parameter, which goes from the perimeter to the origin. Typically 0, must be in the range [0, 1].
vMax
Maximum value of the v parameter, which goes from the perimeter to the origin. Typically 1, must be in the range [0, 1].
diskAttributeSet
Attributes for the disk. May be NULL.

TQ3EllipseData


typedef struct TQ3EllipseData {
    TQ3Point3D                                  origin;
    TQ3Vector3D                                 majorRadius;
    TQ3Vector3D                                 minorRadius;
    float                                       uMin;
    float                                       uMax;
    TQ3AttributeSet                             ellipseAttributeSet;
} TQ3EllipseData;
Discussion

Data describing the state of an ellipse. The major radius and minor radius vectors need not be orthogonal, though they should be independent.

You can make a partial ellipse by using values other than 0 and 1 for the uMin and uMax fields. The ellipse travels counterclockwise from the uMin to the uMax value. It is permissible for uMin to be greater than uMax. For example, if uMin = 7/8 and uMax = 1/8, then the ellipse covers a range of 45 degrees, including the zero angle.

Field Descriptions
origin
Center of the ellipse.
majorRadius
A vector from the origin to a point on the curve.
minorRadius
Another vector from the origin to a point on the curve.
uMin
Starting value of the u parameter. Typically 0.
uMax
Ending value of the u parameter. Typically 1.
ellipseAttributeSet
Attributes for the ellipse. May be NULL.

TQ3EllipsoidData


typedef struct TQ3EllipsoidData {
    TQ3Point3D                                  origin;
    TQ3Vector3D                                 orientation;
    TQ3Vector3D                                 majorRadius;
    TQ3Vector3D                                 minorRadius;
    float                                       uMin;
    float                                       uMax;
    float                                       vMin;
    float                                       vMax;
    TQ3EndCap                                   caps;
    TQ3AttributeSet                             interiorAttributeSet;
    TQ3AttributeSet                             ellipsoidAttributeSet;
} TQ3EllipsoidData;
Discussion

Data describing the state of an ellipsoid. The major axis, minor axis, and orientation vectors need not be orthogonal, but should be independent, i.e., not coplanar.

The ellipsoid can be expressed by a parametric equation

f(u,v) = origin - cos(πv)orientation + sin(πv)(cos(2πu)majorRadius + sin(2πu)minorRadius)

where u and v range from 0 to 1.

The values uMin, uMax, vMin, and vMax allow partial ellipsoids, e.g., an ellipsoid with a wedge cut out of it. Partial ellipsoids were not implemented in QuickDraw 3D.

Field Descriptions
origin
Center of the ellipsoid.
orientation
A vector from the origin to a point on the ellipsoid.
majorRadius
A vector from the origin to a point on the ellipsoid.
minorRadius
A vector from the origin to a point on the ellipsoid.
uMin
Minimum value of the u parameter, which goes around the perimeter (the ellipse determined by the major and minor axes). Typically 0.
uMax
Maximum value of the u parameter. Typically 1.
vMin
Minimum value of the v parameter, which goes from the south pole (origin - orientation) to the north pole (origin + orientation). Typically 0.
vMax
Minimum value of the v parameter. Typically 1.
caps
Style of caps to be used on partial ellipsoids.
interiorAttributeSet
Interior attributes, used for end or interior caps. May be NULL.
ellipsoidAttributeSet
Attributes for the ellipsoid surface. May be NULL.

TQ3GeneralPolygonContourData


typedef struct TQ3GeneralPolygonContourData {
    TQ3Uns32                                    numVertices;
    TQ3Vertex3D                                 *vertices;
} TQ3GeneralPolygonContourData;
Discussion

An ordered list of vertices forming a contour of a general polygon. Used within the TQ3GeneralPolygonData structure.

Field Descriptions
numVertices
Number of vertices. Must be at least 3.
vertices
Array of vertices.

TQ3GeneralPolygonData


typedef struct TQ3GeneralPolygonData {
    TQ3Uns32                                    numContours;
    TQ3GeneralPolygonContourData                *contours;
    TQ3GeneralPolygonShapeHint                  shapeHint;
    TQ3AttributeSet                             generalPolygonAttributeSet;
} TQ3GeneralPolygonData;
Discussion

Data describing a general polygon. A general polygon is a closed figure defined by one or more coplanar closed curves called contours. If there are holes, the even-odd rule determines which parts are inside.

Field Descriptions
numContours
Number of contours in the following array. Must be at least 1.
contours
Array of contours.
shapeHint
Information about the shape of the general polygon, which may be used by the renderer to optimize drawing.
generalPolygonAttributeSet
Set of attributes for the polygon. May be NULL.

TQ3LineData


typedef struct TQ3LineData {
    TQ3Vertex3D                                 vertices[2];
    TQ3AttributeSet                             lineAttributeSet;
} TQ3LineData;
Discussion

Data describing a line.

Field Descriptions
vertices
Array of two vertices, the ends of the line.
lineAttributeSet
Set of attributes for the line. May be NULL.

TQ3MarkerData


typedef struct TQ3MarkerData {
    TQ3Point3D                                  location;
    TQ3Int32                                    xOffset;
    TQ3Int32                                    yOffset;
    TQ3Bitmap                                   bitmap;
    TQ3AttributeSet                             markerAttributeSet;
} TQ3MarkerData;
Discussion

Data describing a bitmap marker, a 2-dimensional image drawn on top of a scene at a specified location.

Field Descriptions
location
Location of the marker, in local coordinates.
xOffset
Horizontal offset from the location to the upper left corner of the marker, in pixels.
yOffset
Vertical offset from the location to the upper left corner of the marker, in pixels.
bitmap
A bitmap. Each bit corresponds to a pixel in the image.
markerAttributeSet
Marker attributes, which can for instance modify the color or transparency of the 1 bits. May be NULL.

TQ3MeshContourData


typedef struct TQ3MeshContourData {
    TQ3Uns32                                    numVertices;
    TQ3Uns32                                    *vertexIndices;
} TQ3MeshContourData;
Discussion

Data describing a contour within a mesh face.

Note that a TQ3MeshContourData is an external data structure for use with the Q3Mesh_Set/Get/EmptyData functions. In contrast, a TQ3MeshContour is a pointer to an opaque internal data structure, which is most likely not a TQ3MeshContourData.

This structure is not available in QD3D.

Field Descriptions
numVertices
Number of vertices. Must be at least 3.
vertexIndices
Indices of the vertices of the contour.

TQ3MeshCornerData


typedef struct TQ3MeshCornerData {
    TQ3Uns32                                    numFaces;
    TQ3Uns32                                *faceIndices;
    TQ3AttributeSet                             cornerAttributeSet;
} TQ3MeshCornerData;
Discussion

Data describing a corner for a mesh vertex.

Note that a TQ3MeshCornerData is an external data structure for use with the Q3Mesh_Set/Get/EmptyData functions.

This structure is not available in QD3D.

Field Descriptions
numFaces
Number of faces. Must be at least 1.
faceIndices
Indices of the faces.
cornerAttributeSet
Set of attributes for the corner. Should not be NULL.

TQ3MeshData


typedef struct TQ3MeshData {
    TQ3Uns32                  numVertices;
    TQ3MeshVertexData              *vertices;
    TQ3Uns32                  numEdges;
    TQ3MeshEdgeData                *edges;
    TQ3Uns32                  numFaces;
    TQ3MeshFaceData                *faces;
    TQ3AttributeSet                meshAttributeSet;
} TQ3MeshData;
Discussion

Data describing a mesh.

Note that a TQ3MeshData is an external data structure for use with the Q3Mesh_Set/Get/EmptyData functions.

This structure is not available in QD3D.

Field Descriptions
numVertices
Number of vertices in the following array.
vertices
Pointer to array of vertices of the mesh.
numEdges
Number of edges in the following array. May be 0 if you do not want to specify any edges.
edges
Pointer to an array of edges. May be NULL if you also specify 0 for numEdges.
numFaces
Number of faces in the mesh.
faces
Pointer to an array of faces.
meshAttributeSet
Set of attributes for the mesh. May be NULL.

TQ3MeshEdgeData


typedef struct TQ3MeshEdgeData {
    TQ3Uns32                                    vertexIndices[2];
    TQ3AttributeSet                             edgeAttributeSet;
} TQ3MeshEdgeData;
Discussion

Data describing an edge within a mesh. Used within the TQ3MeshData structure.

Note that a TQ3MeshEdgeData is an external data structure for use with the Q3Mesh_Set/Get/EmptyData functions. In contrast, a TQ3MeshEdge is a pointer to an opaque internal data structure, which is most likely not a TQ3MeshEdgeData.

This structure is not available in QD3D.

Field Descriptions
vertexIndices
Indices of the two vertices that are ends of the edge.
edgeAttributeSet
Set of attributes for the edge. May be NULL.

TQ3MeshFaceData


typedef struct TQ3MeshFaceData {
    TQ3Uns32                                    numContours;
    TQ3MeshContourData                          *contours;
    TQ3AttributeSet                             faceAttributeSet;
} TQ3MeshFaceData;
Discussion

Data describing a face within a mesh.

Note that a TQ3MeshFaceData is an external data structure for use with the Q3Mesh_Set/Get/EmptyData functions. In contrast, a TQ3MeshFace is a pointer to an opaque internal data structure, which is most likely not a TQ3MeshFaceData.

This structure is not available in QD3D.

Field Descriptions
numContours
Number of contours. Must be at least 1.
contours
Contours of the face.
faceAttributeSet
Set of attributes for the face. May be NULL.

TQ3MeshIterator


typedef struct TQ3MeshIterator {
    void                                        *var1;
    void                                        *var2;
    void                                        *var3;
    struct {
    void                                    *field1;
    char                                    field2[4];
    
} var4;
Discussion

This structure is used for iterating through various parts of a Mesh. You should consider it opaque, because the meanings of the fields are not documented.


TQ3MeshVertexData


typedef struct TQ3MeshVertexData {
    TQ3Point3D                                  point;
    TQ3Uns32                                    numCorners;
    TQ3MeshCornerData                           *corners;
    TQ3AttributeSet                             attributeSet;
} TQ3MeshVertexData;
Discussion

Data describing a vertex within a mesh.

Note that a TQ3MeshVertexData is an external data structure for use with the Q3Mesh_Set/Get/EmptyData functions. In contrast, a TQ3MeshVertex is a pointer to an opaque internal data structure, which is most likely not a TQ3MeshVertexData.

This structure is not available in QD3D.

Field Descriptions
point
Location of the vertex.
numCorners
Number of corners in the following array. May be 0 if you do not want to specify any corners.
corners
Pointer to an array of corners. May be NULL if you also specify 0 for numCorners.
attributeSet
Attribute set for the vertex.

TQ3NURBCurveData


typedef struct TQ3NURBCurveData {
    TQ3Uns32                                    order;
    TQ3Uns32                                    numPoints;
    TQ3RationalPoint4D                          *controlPoints;
    float                                       *knots;
    TQ3AttributeSet                             curveAttributeSet;
} TQ3NURBCurveData;
Discussion

Data defining a NURBS curve, a 3-dimensional curve represented by a nonuniform rational B-spline equation.

Field Descriptions
order
The order of the curve, one more than the degree of the polynomials defining the curve. Must be greater than one.
numPoints
Number of control points. Must be greater than or equal to the order.
controlPoints
Array of rational 4-dimensional control points.
knots
Array of knots that define the curve. The number of knots must equal the sum of order and numPoints. The values must be nondecreasing.
curveAttributeSet
Set of attributes for the curve. May be NULL.

TQ3NURBPatchData


typedef struct TQ3NURBPatchData {
    TQ3Uns32                                    uOrder;
    TQ3Uns32                                    vOrder;
    TQ3Uns32                                    numRows;
    TQ3Uns32                                    numColumns;
    TQ3RationalPoint4D                          *controlPoints;
    float                                       *uKnots;
    float                                       *vKnots;
    TQ3Uns32                                    numTrimLoops;
    TQ3NURBPatchTrimLoopData                    *trimLoops;
    TQ3AttributeSet                             patchAttributeSet;
} TQ3NURBPatchData;
Discussion

Data describing a NURB patch, a surface defined by a ratio of B-spline surfaces.

Field Descriptions
uOrder
Order of the NURB patch in the u parametric direction. The order is one greater than the degree of the polynomial functions involved, and must be greater than one.
vOrder
Order of the NURB patch in the v parametric direction. The order is one greater than the degree of the polynomial functions involved, and must be greater than one.
numRows
Number of control points in the u parametric equation. Must be greater than 1.
numColumns
Number of control points in the v parametric equation. Must be greater than 1.
controlPoints
Array of rational 4-dimensional control points. They are listed first in the direction of increasing u and then in the direction of increasing v. The number of control points is numRows times numColumns.
uKnots
Array of knots in the u parametric direction. The number of these knots is the sum of uOrder and numColumns. The values must be nondecreasing.
vKnots
Array of knots in the v parametric direction. The number of these knots is the sum of vOrder and numRows. The values must be nondecreasing.
numTrimLoops
Number of trim loops in the following array. Currently this should be 0.
trimLoops
Pointer to an array of trim loop structures. Currently this should be NULL.
patchAttributeSet
Set of attributes for the patch. May be NULL.

TQ3NURBPatchTrimCurveData


typedef struct TQ3NURBPatchTrimCurveData {
    TQ3Uns32                                    order;
    TQ3Uns32                                    numPoints;
    TQ3RationalPoint3D                          *controlPoints;
    float                                       *knots;
} TQ3NURBPatchTrimCurveData;
Discussion

Curve that trims a NURB patch. Note that this is similar to TQ3NURBCurveData, but lacks an attribute set.

Field Descriptions
order
The order of the curve, one more than the degree of the polynomials defining the curve. Must be greater than one.
numPoints
Number of control points. Must be greater than or equal to the order.
controlPoints
Array of rational 4-dimensional control points.
knots
Array of knots that define the curve. The number of knots must equal the sum of order and numPoints. The values must be nondecreasing.

TQ3NURBPatchTrimLoopData


typedef struct TQ3NURBPatchTrimLoopData {
    TQ3Uns32                                    numTrimCurves;
    TQ3NURBPatchTrimCurveData                   *trimCurves;
} TQ3NURBPatchTrimLoopData;
Discussion

Data describing curves that trim a NURB patch.

Field Descriptions
numTrimCurves
Number of curves in the following array.
trimCurves
Pointer to an array of curves.

TQ3PixmapMarkerData


typedef struct TQ3PixmapMarkerData {
    TQ3Point3D                                  position;
    TQ3Int32                                    xOffset;
    TQ3Int32                                    yOffset;
    TQ3StoragePixmap                            pixmap;
    TQ3AttributeSet                             pixmapMarkerAttributeSet;
} TQ3PixmapMarkerData;
Discussion

Data describing a pixmap marker, a 2-dimensional color image drawn on top of a scene at a specified location.

Field Descriptions
position
Location of the marker, in local coordinates.
xOffset
Horizontal offset from the position to the upper left corner of the marker, in pixels.
yOffset
Vertical offset from the position to the upper left corner of the marker, in pixels.
pixmap
A pixmap.
pixmapMarkerAttributeSet
A set of attributes for the marker. May be NULL.

TQ3PointData


typedef struct TQ3PointData {
    TQ3Point3D                                  point;
    TQ3AttributeSet                             pointAttributeSet;
} TQ3PointData;
Discussion

Data describing a point object.

Field Descriptions
point
Location of the point.
pointAttributeSet
Set of attributes for the point. May be NULL.

TQ3PolyLineData


typedef struct TQ3PolyLineData {
    TQ3Uns32                                    numVertices;
    TQ3Vertex3D                                 *vertices;
    TQ3AttributeSet                             *segmentAttributeSet;
    TQ3AttributeSet                             polyLineAttributeSet;
} TQ3PolyLineData;
Discussion

Data describing a connected but not closed curve made up of several straight line segments.

Field Descriptions
numVertices
Number of vertices of the curve (one more than the number of line segments). Must be at least 2.
vertices
Pointer to an array of vertices.
segmentAttributeSet
Pointer to an array of attribute sets, one for each segment. If you do not want to assign attributes to any segment, this pointer may be NULL.
polyLineAttributeSet
Set of attributes for the whole curve. May be NULL.

TQ3PolygonData


typedef struct TQ3PolygonData {
    TQ3Uns32                                    numVertices;
    TQ3Vertex3D                                 *vertices;
    TQ3AttributeSet                             polygonAttributeSet;
} TQ3PolygonData;
Discussion

Data describing a simple convex polygon.

Field Descriptions
numVertices
Number of vertices. Must be at least 3.
vertices
Pointer to an array of vertices.
polygonAttributeSet
Set of attributes for the polygon. May be NULL.

TQ3PolyhedronData


typedef struct TQ3PolyhedronData {
    TQ3Uns32                                    numVertices;
    TQ3Vertex3D                                 *vertices;
    TQ3Uns32                                    numEdges;
    TQ3PolyhedronEdgeData                       *edges;
    TQ3Uns32                                    numTriangles;
    TQ3PolyhedronTriangleData                   *triangles;
    TQ3AttributeSet                             polyhedronAttributeSet;
} TQ3PolyhedronData;
Discussion

Data describing a polyhedron.

Field Descriptions
numVertices
Number of vertices in the following array.
vertices
Pointer to array of vertices of the polyhedron.
numEdges
Number of edges in the following array. May be 0 if you do not want to specify any edges.
edges
Pointer to an array of edges. May be NULL if you also specify 0 for numEdges.
numTriangles
Number of triangles (faces) in the polygon.
triangles
Pointer to an array of triangles.
polyhedronAttributeSet
Set of attributes for the polyhedron. May be NULL.

TQ3PolyhedronEdgeData


typedef struct TQ3PolyhedronEdgeData {
    TQ3Uns32                                    vertexIndices[2];
    TQ3Uns32                                    triangleIndices[2];
    TQ3AttributeSet                             edgeAttributeSet;
} TQ3PolyhedronEdgeData;
Discussion

Data describing an edge within a polyhedron.

Field Descriptions
vertexIndices
Indices of the two vertices that are ends of the edge.
triangleIndices
Indices of the two triangles that contain the edge.
edgeAttributeSet
Set of attributes for the edge. May be NULL.

TQ3PolyhedronTriangleData


typedef struct TQ3PolyhedronTriangleData {
    TQ3Uns32                                    vertexIndices[3];
    TQ3PolyhedronEdge                           edgeFlag;
    TQ3AttributeSet                             triangleAttributeSet;
} TQ3PolyhedronTriangleData;
Discussion

Data describing a triangle within a polyhedron.

Field Descriptions
vertexIndices
Indices of the 3 vertices of the triangle.
edgeFlag
Flags indicating which edges of the triangle should be rendered. See TQ3PolyhedronEdgeMasks.
triangleAttributeSet
Set of attributes for the triangle. May be NULL.

TQ3TorusData


typedef struct TQ3TorusData {
    TQ3Point3D                                  origin;
    TQ3Vector3D                                 orientation;
    TQ3Vector3D                                 majorRadius;
    TQ3Vector3D                                 minorRadius;
    float                                       ratio;
    float                                       uMin;
    float                                       uMax;
    float                                       vMin;
    float                                       vMax;
    TQ3EndCap                                   caps;
    TQ3AttributeSet                             interiorAttributeSet;
    TQ3AttributeSet                             torusAttributeSet;
} TQ3TorusData;
Discussion

Data describing a generalized torus. A torus is a surface formed by rotating an ellipse about an axis that is in the same plane as the ellipse but does not pass through the ellipse.

To express the torus as a parametric equation, we first define the elliptical central axis by the equation

axis(u) = cos(2πu) majorRadius + sin(2πu) minorRadius

where majorRadius and minorRadius are independent vectors, and u varies from 0 to 1. Then we define the torus surface by

f(u,v) = origin + axis(u) - sin(2πv) orientation - (cos(2πv) * ratio * |orientation| / |axis(u)|) axis(u)

where v also varies from 0 to 1 and vertical bars indicate length of a vector.

The kind of torus usually encountered in elementary mathematics, with circular cross sections, would be one where the orientation, majorRadius, and minorRadius vectors are mutually orthogonal, where majorRadius and minorRadius have the same length, and where ratio is 1.

The values uMin, uMax, vMin, and vMax allow one to create partial tori, e.g., a torus with a wedge cut out of it. QuickDraw 3D did not implement this feature.

Field Descriptions
origin
Center of rotation.
orientation
Vector whose direction is the axis of rotation, and whose length is the length of the radius of the cross-sectional ellipse in the direction of the axis of rotation.
majorRadius
Vector from the origin to the center of the ellipse.
minorRadius
Vector from the origin to the center of a different cross-sectional ellipse.
ratio
The ratio between the radius of the cross-sectional ellipse in the direction of majorRadius, and the length of orientation.
uMin
Minimum value in the u parametric direction (the long way around.) Normally 0, must be in interval [0, 1].
uMax
Maximum value in the u parametric direction (the long way around.) Normally 1, must be in interval [0, 1].
vMin
Minimum value in the v parametric direction (the short way around.) Normally 0, must be in interval [0, 1].
vMax
Maximum value in the v parametric direction (the short way around.) Normally 1, must be in interval [0, 1].
caps
Cap style. Should be kQ3EndCapNone.

interiorAttributeSet
Interior attribute set. Not currently used.

torusAttributeSet
Overall attribute set.

TQ3TriGridData


typedef struct TQ3TriGridData {
    TQ3Uns32                                    numRows;
    TQ3Uns32                                    numColumns;
    TQ3Vertex3D                                 *vertices;
    TQ3AttributeSet                             *facetAttributeSet;
    TQ3AttributeSet                             triGridAttributeSet;
} TQ3TriGridData;
Discussion

Data describing a TriGrid object. A TriGrid is defined by a grid of points in 3-dimensional space. Each set of 4 adjacent points (in the mth and (m+1)st row and nth and (n+1)st column) defines a quadrilateral that can be subdivided into triangles in 2 natural ways. This subdivision is done in an alternating way, such that the vertex in the first row and first column belongs to two triangles.

Field Descriptions
numRows
Number of rows of vertices. Should be at least 2.
numColumns
Number of columns of vertices. Should be at least 2.
vertices
Pointer to an array of vertices, listed in rectangular order, first by increasing columns and then by increasing rows. The number of vertices should be numRows times numColumns.
facetAttributeSet
Pointer to an array of triangle attributes. May be NULL, but otherwise should point to an array of 2×(numRows-1)×(numColumns-1) attribute sets.
triGridAttributeSet
Set of attributes for the whole TriGrid object. May be NULL.

TQ3TriMeshAttributeData


typedef struct TQ3TriMeshAttributeData {
    TQ3AttributeType                            attributeType;
    void                                        *data;
    char                                        *attributeUseArray;
} TQ3TriMeshAttributeData;
Discussion

A structure holding an array of attribute data of a particular type.

Field Descriptions
attributeType
Type of the attribute.
data
Pointer to an array of attribute data. The number of members in the array is determined by context in the enclosing TQ3TriMeshData structure; for instance, if these are vertex attributes, the number of members is the number of vertices. The size of each member depends on the attribute type.
attributeUseArray
For non-custom attribute types, this must be NULL. For custom attribute types, it can point to an array of 1-byte 0s and 1s, with 1s indicating which items have the custom attribute.

TQ3TriMeshData


typedef struct TQ3TriMeshData {
    TQ3AttributeSet                             triMeshAttributeSet;
    TQ3Uns32                                    numTriangles;
    TQ3TriMeshTriangleData                      *triangles;
    TQ3Uns32                                    numTriangleAttributeTypes;
    TQ3TriMeshAttributeData                     *triangleAttributeTypes;
    TQ3Uns32                                    numEdges;
    TQ3TriMeshEdgeData                          *edges;
    TQ3Uns32                                    numEdgeAttributeTypes;
    TQ3TriMeshAttributeData                     *edgeAttributeTypes;
    TQ3Uns32                                    numPoints;
    TQ3Point3D                                  *points;
    TQ3Uns32                                    numVertexAttributeTypes;
    TQ3TriMeshAttributeData                     *vertexAttributeTypes;
    TQ3BoundingBox                              bBox;
} TQ3TriMeshData;
Discussion

Structure describing a TriMesh object, which is an object composed of vertices, edges, and triangular faces. The main difference between a TriMesh and a Polyhedron is that attribute data for vertices, edges, and faces are not stored in attribute sets, but in arrays of attribute data. This is normally more efficient, so long as you are going to be assigning an attribute to every vertex, or every edge, or every face.

Field Descriptions
triMeshAttributeSet
Set of attributes for the whole object. May be NULL.
numTriangles
Number of triangles in the following array.
triangles
Pointer to an array of triangle data.
numTriangleAttributeTypes
Number of triangle attribute types listed in the following array.
triangleAttributeTypes
Pointer to an array of attribute data for triangles (faces). May be NULL, if numTriangleAttributeTypes is 0.
numEdges
Number of edges in the following array.
edges
Pointer to an array of edge data. If you do not wish to specify any edges, you can set this to NULL, and set numEdges to 0.
numEdgeAttributeTypes
Number of edge attribute types in the following array.
edgeAttributeTypes
Pointer to an array of edge attribute types. May be NULL, provided that numEdgeAttributeTypes is 0.
numPoints
Number of points (vertices).
points
Pointer to an array of points.
numVertexAttributeTypes
Number of vertex attribute types in the following array.
vertexAttributeTypes
Pointer to an array of vertex attribute data. May be NULL, so long as numVertexAttributeTypes is 0.
bBox
Bounding box of the TriMesh.

TQ3TriMeshEdgeData


typedef struct TQ3TriMeshEdgeData {
    TQ3Uns32                                    pointIndices[2];
    TQ3Uns32                                    triangleIndices[2];
} TQ3TriMeshEdgeData;
Discussion

Data defining an edge within a TriMesh.

Field Descriptions
pointIndices
Array of 2 indices into the TriMesh array of points, the ends of the edge.
triangleIndices
Array of 2 indices into the TriMesh array of triangles, the triangles containing the edge.

TQ3TriMeshTriangleData


typedef struct TQ3TriMeshTriangleData {
    TQ3Uns32                                    pointIndices[3];
} TQ3TriMeshTriangleData;
Discussion

Data defining a triangle within a TriMesh.

Field Descriptions
pointIndices
Array of 3 indices into the TriMesh array of points.

TQ3TriangleData


typedef struct TQ3TriangleData {
    TQ3Vertex3D                                 vertices[3];
    TQ3AttributeSet                             triangleAttributeSet;
} TQ3TriangleData;
Discussion

Data defining a single triangle.

Field Descriptions
vertices
The 3 vertices of the triangle.
triangleAttributeSet
Set of attributes for the triangle. May be NULL.

© 1999-2008 Quesa Developers (Last Updated 5/10/2008)