Polyhedron AttributesAttribute Operations The following is the complete list of legal values for the attribute opcodes. The format of the data depends on the opcode.
TKE_Shell and TKE_Mesh (a.k.a. polyhedra) suboptions
and TKE_PolyCylinder flags have a bit to indicate the presence of
"optionals" (a.k.a. attributes) on the faces, vertices, or edges.
If that bit is set, There will be a list of one or more attribute operations followed by an OPT_TERMINATE.
Thus, the structure of this list is similar to a list of primitives in a segment,
except that the opcodes and formats are specific to attributes.
The meaning of most of the attribute should be apparent from the name of the opcode. "Normals" are vertex normals.
"Parameters" are texture coordinates bound to vertices. "Indices" are values for looking up into a previously defined color look-up table.
Vertex colors and indices can affect marker, face or edge appearance, as specified with "vm", "ve", or "vf".
Operations to Define Values Everywhere
note that the "parameter width" field, (which indicates the number of values on each vertex) is only used by OPT_ALL_PARAMETERS
note that the "parameter width" field, (which indicates the number of values on each vertex) is only used by OPT_ALL_PARAMETERS
In the above format, "count" specifies the number of values that are defined. "Indices" and
is an array of size-dependent values. They will be unsigned values that are
8-bit unsigned characters, 16-bit unsigned shorts, or 32-bit unsigned integers, rounded up from
the number of bits required to store the point count (face count in the case of OPT_FACE_COLORS
or OPT_FACE_INDICES). "Data" is an array of unsigned values packed bitwise with no padding between
entries whatsoever.
With this format, some of the values may be left undefined. They take on
default or inherited values from elsewhere in a manner specific to the application and/or graphics
system.
Points, normals, colors, color indices and parameters (a.k.a. texture coordinates) are all fundamentally
arrays of floating point values. Of those, all but points are given as part of the polyhedron optionals
("points" are defined as part of TKE_Shell and TKE_Mesh
which have links to this section for the definition of an "array of compressed floats"). The following schemes
are currently defined:
CS_TRIVIAL
If the value to be encoded has a variable number of dimensions (e.g. vertex parameters,
a.k.a. texture coordinates). Under the CS_TRIVIAL scheme, the array consists of a minimum for each dimension,
followed by a maximum for each dimension. All are encoded as 32-bit floats. Next comes a packed
array of raw data samples. The initial bounding volume is omitted when possible:
CS_TRIVIAL_IMPLICIT (obsolete)
CS_TRIVIAL_IMPLICIT differs from CS_TRIVIAL only in that the bounding cuboid is inferred from the nature of the
data it is encoding. CS_TRIVIAL_IMPLICIT can be used only for normals, colors, parameters and colors-by-index.
For normals, the assumed bounding box is {-1,-1,-1,1,1,1}. For the colors, the assumption is {0,0,0,1,1,1}.
This compression scheme was deprecated because of the observation that the difference between CS_TRIVIAL and
CS_TRIVIAL_IMPLICIT could be inferred from context.
CS_REPULSE
CS_REPULSE is defined only for bits_per_sample values of 8 and 10. A predefined set of unit
vectors is hardcoded into both
the reading and writing sides. The bit-packed array of samples is interpreted as indices into this array of
hardcoded unit vectors. The last index in both the 8 and 10 bit versions is a reserved value that indicates
that the normal is not valid (left for the receiving end's graphics system to compute). For the definition
of the predefined unit vectors, see repulse_data.html.
If face regions are defined, they are specified as one Int per face,which may then be compressed. The form of
storage is defined by
The upper part (compression_scheme & 0xF8) defines the storage size of all the following values:
Face region support was added in HSF format 7.05.
If polyhedron attributes are defined, they are attributes (such as color) which are set at the geometry level (as opposed
to the segment level or the face/edge/vertex level). They are stored as one or more normal attributes followed by a
TKE_Termination opcode (distinct from the OPT_TERMINATE which is required when all optional fields are done).
Polyhedron attribute support was added in HSF format 7.05.
|