📄 file-format.html
字号:
</ul>
The meaning of the components is given in the documentation for the <a href="javax/microedition/m3g/Image2D.html">Image2D</a>
class.
<h3>
<a NAME="IndexBuffer"></a>11.11 IndexBuffer</h3>
ObjectType: <i>none (abstract base class)</i>
<br>Superclass data: <a href="#Object3D">Object3D</a>
<br>Followed by: <i>no data (abstract class)</i>
<h3>
<a NAME="KeyframeSequence"></a>11.12 KeyframeSequence</h3>
ObjectType: 19
<br>Superclass data: <a href="#Object3D">Object3D</a>
<br>Followed by:
<blockquote>
<pre>Byte interpolation;
Byte repeatMode;
Byte encoding;
UInt32 duration;
UInt32 validRangeFirst;
UInt32 validRangeLast;
UInt32 componentCount;
UInt32 keyframeCount;
<i>IF encoding == 0
FOR each key frame...
</i> Int32 time;
Float32[componentCount] vectorValue;
<i> END
ELSE IF encoding == 1
</i> Float32[componentCount] vectorBias;
Float32[componentCount] vectorScale;
<i> FOR each key frame...
</i> Int32 time;
Byte[componentCount] vectorValue;
<i> END
ELSE IF encoding == 2
</i> Float32[componentCount] vectorBias;
Float32[componentCount] vectorScale;
<i> FOR each key frame...
</i> Int32 time;
UInt16[componentCount] vectorValue;
<i> END
END</i></pre>
</blockquote>
The <tt>interpolation</tt> and <tt>repeatMode</tt> fields must each hold
a valid
<a href="javax/microedition/m3g/KeyframeSequence.html#field_summary">enumerated
value</a>, as specified in the class definition. Other values must be treated
as errors.
<p>All of the <tt>vectorValue</tt> arrays are the same size, so a separate
count is stored outside the individual keyframe's data rather than with
each array.
<p>The <tt>encoding</tt> field indicates the encoding scheme to be used
for the keyframe data. Only the nominated values above are allowed. Other
values must be treated as errors.
<ul>
<li>
Encoding 0 indicates that the values are stored "raw" as floats.</li>
<li>
Encodings 1 and 2 indicate that the values are quantized to 1 or 2 bytes.
For each component, a bias and scale are calculated from the sequence of
values for that component. The bias is the mimimum value, the scale is
the maximum value minus the minimum value. The raw values are then converted
to a value 0..1 by subtracting the bias and dividing by the scale. These
raw values are then quantized into the range of a Byte or UInt16 by multiplying
by 255 or 65535 respectively. The converse operation restores the original
value from the quantized values.</li>
</ul>
<h3>
<a NAME="Light"></a>11.13 Light</h3>
ObjectType: 12
<br>Superclass data: <a href="#Node">Node</a>
<br>Followed by:
<blockquote>
<pre>Float32 attenuationConstant;
Float32 attenuationLinear;
Float32 attenuationQuadratic;
ColorRGB color;
Byte mode;
Float32 intensity;
Float32 spotAngle;
Float32 spotExponent;</pre>
</blockquote>
The <tt>mode</tt> field must hold a valid <a href="javax/microedition/m3g/Light.html#field_summary">enumerated
value</a>, as specified in the class definition. Other values must be treated
as errors.
<h3>
<a NAME="Loader"></a>11.14 Loader</h3>
<i>Not a serializable class.</i>
<h3>
<a NAME="Material"></a>11.15 Material</h3>
ObjectType: 13
<br>Superclass data: <a href="#Object3D">Object3D</a>
<br>Followed by:
<blockquote>
<pre>ColorRGB ambientColor;
ColorRGBA diffuseColor;
ColorRGB emissiveColor;
ColorRGB specularColor;
Float32 shininess;
Boolean vertexColorTrackingEnabled;</pre>
</blockquote>
<h3>
<a NAME="Mesh"></a>11.16 Mesh</h3>
ObjectType: 14
<br>Superclass data: <a href="#Node">Node</a>
<br>Followed by:
<blockquote>
<pre>ObjectIndex vertexBuffer;
UInt32 submeshCount;
<i>FOR each submesh...
</i> ObjectIndex indexBuffer;
ObjectIndex appearance;
<i>END</i></pre>
</blockquote>
<h3>
<a NAME="MorphingMesh"></a>11.17 MorphingMesh</h3>
ObjectType: 15
<br>Superclass data: <a href="#Mesh">Mesh</a>
<br>Followed by:
<blockquote>
<pre>UInt32 morphTargetCount;
<i>FOR each target buffer...
</i> ObjectIndex morphTarget;
Float32 initialWeight;
<i>END</i></pre>
</blockquote>
<h3>
<a NAME="Node"></a>11.18 Node</h3>
ObjectType: <i>none (abstract base class)</i>
<br>Superclass data: <a href="#Transformable">Transformable</a>
<br>Followed by:
<blockquote>
<pre>Boolean enableRendering;
Boolean enablePicking;
Byte alphaFactor;
UInt32 scope;
Boolean hasAlignment;
<i>IF hasAlignment==TRUE, THEN
</i> Byte zTarget;
Byte yTarget;
ObjectIndex zReference;
ObjectIndex yReference;
<i>END</i></pre>
</blockquote>
The <tt>zTarget</tt> and <tt>yTarget</tt> fields must each hold a valid
<a href="javax/microedition/m3g/Node.html#field_summary">enumerated
value</a>, as specified in the class definition. Other values must be treated
as errors.
<p>The <tt>alphaFactor</tt> field is stored as a byte to save space. It
is mapped so that 0x00 is equivalent to 0.0 (fully transparent), and 255
is equivalent to 1.0 (fully opaque).
<p>If the <tt>hasAlignment</tt> field is <tt>false</tt>, the omitted fields
are initialized to their default values.
<h3>
<a NAME="Object3D"></a>11.19 Object3D</h3>
ObjectType: <i>none (abstract base class)</i>
<br>Superclass data: <i>none</i>
<br>Followed by:
<blockquote>
<pre>UInt32 userID;
ObjectIndex[] animationTracks;
UInt32 userParameterCount;
<i>FOR each user parameter...
</i> UInt32 parameterID;
Byte[] parameterValue;
<i>END</i>
</pre>
</blockquote>
The userID field may be any value.
<p>The user parameter data contains enough data to create a
<tt>java.util.Hashtable</tt> object. This contains key/value pairs,
with the key being the <tt>parameterID</tt>, and the value being the
<tt>parameterValue</tt> byte array. The meanings of the IDs, and the
contents of the byte arrays, are defined by the application and may
have any value.
<p>The behaviour of the <tt>java.util.Hashtable</tt> class does not
allow multiple objects with the same key. Therefore, duplicate
<tt>parameterID</tt> values are not allowed and must be reported as an
error.
<p>If an object has no user parameters, the
<tt>userParameterCount</tt> field must be 0. In this case, the user
object in the resulting Object3D instance must be set to
<tt>null</tt>, rather than indicating a Hashtable object with no
content. The Hashtable containing the parameters, if it exists, can be
retrieved through the API using the <a
href="javax/microedition/m3g/Object3D.html#getUserObject()">getUserObject</a>
method.
<h3>
<a NAME="PolygonMode"></a>11.20 PolygonMode</h3>
ObjectType: 08
<br>Superclass data: <a href="#Object3D">Object3D</a>
<br>Followed by:
<blockquote>
<pre>Byte culling;
Byte shading;
Byte winding;
Boolean twoSidedLightingEnabled;
Boolean localCameraLightingEnabled;
Boolean perspectiveCorrectionEnabled;</pre>
</blockquote>
The <tt>culling</tt>, <tt>shading</tt> and <tt>winding</tt> fields must
each hold a valid <a href="javax/microedition/m3g/PolygonMode.html#field_summary">enumerated
value</a>, as specified in the class definition. Other values must be treated
as errors.
<h3>
<a NAME="RayIntersection"></a>11.21 RayIntersection</h3>
<i>Not a serializable class.</i>
<h3>
<a NAME="SkinnedMesh"></a>11.22 SkinnedMesh</h3>
ObjectType: 16
<br>Superclass data: <a href="#Mesh">Mesh</a>
<br>Followed by:
<blockquote>
<pre>ObjectIndex skeleton;
UInt32 transformReferenceCount;
<i>FOR each bone reference...
</i> ObjectIndex transformNode;
UInt32 firstVertex;
UInt32 vertexCount;
Int32 weight;
<i>END</i></pre>
</blockquote>
<h3>
<a NAME="Sprite"></a>11.23 Sprite</h3>
ObjectType: 18
<br>Superclass data: <a href="#Node">Node</a>
<br>Followed by:
<blockquote>
<pre>ObjectIndex image;
ObjectIndex appearance;
Boolean isScaled;
Int32 cropX;
Int32 cropY;
Int32 cropWidth;
Int32 cropHeight;</pre>
</blockquote>
<h3>
<a NAME="Texture2D"></a>11.24 Texture2D</h3>
ObjectType: 17
<br>Superclass data: <a href="#Transformable">Transformable</a>
<br>Followed by:
<blockquote>
<pre>ObjectIndex image;
ColorRGB blendColor;
Byte blending;
Byte wrappingS;
Byte wrappingT;
Byte levelFilter;
Byte imageFilter;</pre>
</blockquote>
The <tt>levelFilter</tt>, <tt>imageFilter</tt>, <tt>wrappingS</tt>, <tt>wrappingT</tt>,
and <tt>blending</tt> fields must each hold a valid
<a href="javax/microedition/m3g/Texture2D.html#field_summary">enumerated
value</a>, as specified in the class definition. Other values must be treated
as errors.
<h3>
<a NAME="Transform"></a>11.25 Transform</h3>
<i>Not a serializable class.</i>
<h3>
<a NAME="Transformable"></a>11.26 Transformable</h3>
ObjectType: <i>none (abstract base class)</i>
<br>Superclass data: <a href="#Object3D">Object3D</a>
<br>Followed by:
<blockquote>
<pre>Boolean hasComponentTransform;
<i>IF hasComponentTransform==TRUE, THEN
</i> Vector3D translation;
Vector3D scale;
Float32 orientationAngle;
Vector3D orientationAxis;
<i>END
</i>Boolean hasGeneralTransform;
<i>IF hasGeneralTransform==TRUE, THEN
</i> Matrix transform;
<i>END</i></pre>
</blockquote>
If either <tt>hasComponentTransform</tt> or <tt>hasGeneralTransform</tt>
is <tt>false</tt>, the omitted fields will be initialized to their default
values (equivalent to an identity transform in both cases).
<h3>
<a NAME="TriangleStripArray"></a>11.27 TriangleStripArray</h3>
ObjectType: 11
<br>Superclass data: <a href="#IndexBuffer">IndexBuffer</a>
<br>Followed by:
<blockquote>
<pre>Byte encoding;
<i>IF encoding == 0, THEN
</i> UInt32 startIndex;
<i>ELSE IF encoding == 1, THEN
</i> Byte startIndex;
<i>ELSE IF encoding == 2, THEN
</i> UInt16 startIndex;
<i>ELSE IF encoding == 128, THEN
</i> UInt32[] indices;
<i>ELSE IF encoding == 129, THEN
</i> Byte[] indices;
<i>ELSE IF encoding == 130, THEN
</i> UInt16[] indices;
<i>END
</i>UInt32[] &
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -