All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.io7m.smfj.specification.binary-smf.sdi Maven / Gradle / Ivy

There is a newer version: 0.15.0
Show newest version
[section [title Section - smf] [id smfb.sections.smf]]

[subsection [title Definition] [id smfb.sections.smf.def]]
[paragraph]
The [term [type type] smf] section specifies information common to all
sections in an [term [type type] SMF/B] file.

[subsection [title Cardinality/Ordering] [id smfb.sections.smf.cardinality]]
[paragraph]
An [term [type type] smf] section MUST appear exactly once in an
[term [type type] SMF/B] file.

[paragraph]
The [term [type type] smf] section MUST be the first section in an
[term [type type] SMF/B] file. Implementations MUST reject
[term [type type] SMF/B] files that do not start with an
[term [type type] smf] section.

[subsection [title Magic Number] [id smfb.sections.smf.magic]]
[paragraph]
The [term [type type] smf] section is identified by the magic number
[term [type constant] 0x534D465F48454144].

[subsection [title Data] [id smfb.sections.smf.data]]
[paragraph]
The [term [type type] smf] section begins with the following structure:

[formal-item [title "SMF Header"] [id smfb.sections.smf.header.def]]
[verbatim [include "binary-smf-header.txt"]]

[paragraph]
The [term [type field] schema] field specifies the
[link [target smf_model.schema_id] schema identifier] for the model:

[formal-item [title "Schema Identifier"] [id smfb.sections.smf.header.schema_id.def]]
[verbatim [include "binary-smf-schema.txt"]]

[paragraph]
If the length of the [term [type field] schema_id] field is
[term [type constant] 0], the schema identifier as a whole is ignored.

[paragraph]
The [term [type field] vertex_count] field specifies the number of vertices
that will be specified in a
[link [target smfb.sections.vertices-noninterleaved] vertices-noninterleaved]
section.

[paragraph]
The [term [type field] triangle_count] field specifies the number of triangles
that will be specified in a
[link [target smfb.sections.triangles] triangles] section. The
[term [type field] triangle_size] field specifies the size in bits of the
individual vertex indices within each triangle.

[paragraph]
The [term [type field] attribute_count] field specifies the number of
[link [target smf_model.attribute] attributes] that will be declared. The
[term [type field] attribute_offset] field specifies a relative offset in
octets, from the start of the [term [type field] attribute_offset] field,
at which a list of attributes will be declared. The purpose of this field
is to allow for forward compatibility: Future updates to this specification
may add extra fields to the end of the header structure, and the value of
this field allows older implementations to skip those newer fields.

[paragraph]
The [term [type field] coordinate_system] field specifies the
[link [target smf_model.coords] coordinate system] of the model:

[formal-item [title "Coordinate System"] [id smfb.sections.smf.header.coords.def]]
[verbatim [include "binary-smf-coords.txt"]]

[paragraph]
The [term [type term] axis] and [term [type term] winding order] values are
related to integer values via the following functions:

[formal-item [title "Coordinate System Mapping"] [id smfb.sections.smf.header.coords.map]]
[verbatim [include "axis_map.hs"]]

[paragraph]
Directly following the end of the header structure, is a series of attribute
declarations:

[formal-item [title "Attribute"] [id smfb.sections.smf.header.attribute.def]]
[verbatim [include "binary-smf-attribute.txt"]]

[paragraph]
The [term [type field] name] field specifies the name of the attribute. The
[term [type field] component_kind] field specifies the type of the attribute
components. The [term [type field] component_count] field specifies the number
of components in each value in the attribute, and the
[term [type field] component_size] field specifies the size in bits of each
component value.

[paragraph]
Attribute component types are related to integer values via the following
function:

[formal-item [title "Attribute Type Mapping"] [id smfb.sections.smf.header.attribute.type_map]]
[verbatim [include "attribute_map.hs"]]




© 2015 - 2024 Weber Informatics LLC | Privacy Policy