|
M3G 1.1 -- Jun 22, 2005 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.microedition.m3g.Object3D javax.microedition.m3g.IndexBuffer
An abstract class defining how to connect vertices to form a geometric object.
Each IndexBuffer object defines a submesh, which is the basic rendering primitive in this API. In order to be rendered, a submesh must be associated with a VertexBuffer, defining the vertex attributes, and an Appearance, defining the surface attributes.
IndexBuffer is an abstract class that only provides functionality for querying the stored vertex indices. The actual index values as well as their interpretation are defined in each derived class. Currently, there is only one derived class, TriangleStripArray, which defines a submesh consisting of triangle strips. Other derived classes may be added in future revisions of this API, to support, for example, triangle lists, triangle fans, line strips and quad strips.
The indices in an IndexBuffer are only validated when rendering or
picking. An exception is thrown by the render
methods in
Graphics3D and the pick
methods in Group, if any of the
indices are greater than or equal to the number of vertices in the
associated VertexBuffer. The indices cannot be validated earlier,
because they are allowed to be invalid at all other times except when
they are used by the implementation, that is, when rendering or
picking.
Method Summary | |
int |
getIndexCount()
Returns the number of indices in this buffer. |
void |
getIndices(int[] indices)
Retrieves vertex indices for the rendering primitives stored in this buffer. |
Methods inherited from class javax.microedition.m3g.Object3D |
addAnimationTrack, animate, duplicate, find, getAnimationTrack, getAnimationTrackCount, getReferences, getUserID, getUserObject, removeAnimationTrack, setUserID, setUserObject |
Method Detail |
public int getIndexCount()
getIndices
call. The number of indices returned depends on the type of
low-level rendering primitives in the buffer: Currently, only
triangles are supported, and there are three indices per
triangle. Triangles are counted individually, disregarding
triangle strips.
Note that implementations are allowed to optimize the index data internally. Different implementations may therefore report slightly different index counts for the same set of input primitives.
getIndices
public void getIndices(int[] indices)
The indices returned describe the low-level rendering primitives in this buffer. The only such primitive currently supported is a triangle.
Triangles are returned individually, and each consecutive triplet of indices describes a single triangle. Triangle strips or implicit vs. explicit indices are not represented in the returned data. The triangles need not be in any particular order, but the order of indices in each triangle must preserve the winding of the triangle.
indices
- array to store the returned
vertex indices
java.lang.NullPointerException
- if
indices
is null
java.lang.IllegalArgumentException
- if
indices.length < getIndexCount
|
M3G 1.1 -- Jun 22, 2005 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |