📄 vertexbuffer.html
字号:
<BR>
Gets the current texture coordinate array for the specified texturing unit, or null if texture coordinates for that unit are not set. </TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/m3g/VertexBuffer.html#getVertexCount()">getVertexCount</A></B>()</CODE>
<BR>
Retrieves the current number of vertices in this VertexBuffer. </TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/m3g/VertexBuffer.html#setColors(javax.microedition.m3g.VertexArray)">setColors</A></B>(<A HREF="../../../javax/microedition/m3g/VertexArray.html">VertexArray</A> colors)</CODE>
<BR>
Sets the per-vertex colors for this VertexBuffer. </TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/m3g/VertexBuffer.html#setDefaultColor(int)">setDefaultColor</A></B>(int ARGB)</CODE>
<BR>
Sets the color to use in absence of per-vertex colors. </TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/m3g/VertexBuffer.html#setNormals(javax.microedition.m3g.VertexArray)">setNormals</A></B>(<A HREF="../../../javax/microedition/m3g/VertexArray.html">VertexArray</A> normals)</CODE>
<BR>
Sets the normal vectors for this VertexBuffer. </TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/m3g/VertexBuffer.html#setPositions(javax.microedition.m3g.VertexArray, float, float[])">setPositions</A></B>(<A HREF="../../../javax/microedition/m3g/VertexArray.html">VertexArray</A> positions, float scale, float[] bias)</CODE>
<BR>
Sets the vertex positions for this VertexBuffer. </TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/m3g/VertexBuffer.html#setTexCoords(int, javax.microedition.m3g.VertexArray, float, float[])">setTexCoords</A></B>(int index, <A HREF="../../../javax/microedition/m3g/VertexArray.html">VertexArray</A> texCoords, float scale, float[] bias)</CODE>
<BR>
Sets the texture coordinates for the specified texturing unit. </TD>
</TR>
</TABLE>
<A NAME="methods_inherited_from_class_javax.microedition.m3g.Object3D"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TD><B>Methods inherited from class javax.microedition.m3g.<A HREF="../../../javax/microedition/m3g/Object3D.html">Object3D</A></B></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="../../../javax/microedition/m3g/Object3D.html#addAnimationTrack(javax.microedition.m3g.AnimationTrack)">addAnimationTrack</A>, <A HREF="../../../javax/microedition/m3g/Object3D.html#animate(int)">animate</A>, <A HREF="../../../javax/microedition/m3g/Object3D.html#duplicate()">duplicate</A>, <A HREF="../../../javax/microedition/m3g/Object3D.html#find(int)">find</A>, <A HREF="../../../javax/microedition/m3g/Object3D.html#getAnimationTrack(int)">getAnimationTrack</A>, <A HREF="../../../javax/microedition/m3g/Object3D.html#getAnimationTrackCount()">getAnimationTrackCount</A>, <A HREF="../../../javax/microedition/m3g/Object3D.html#getReferences(javax.microedition.m3g.Object3D[])">getReferences</A>, <A HREF="../../../javax/microedition/m3g/Object3D.html#getUserID()">getUserID</A>, <A HREF="../../../javax/microedition/m3g/Object3D.html#getUserObject()">getUserObject</A>, <A HREF="../../../javax/microedition/m3g/Object3D.html#removeAnimationTrack(javax.microedition.m3g.AnimationTrack)">removeAnimationTrack</A>, <A HREF="../../../javax/microedition/m3g/Object3D.html#setUserID(int)">setUserID</A>, <A HREF="../../../javax/microedition/m3g/Object3D.html#setUserObject(java.lang.Object)">setUserObject</A></CODE></TD>
</TR>
</TABLE>
<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TD><B>Methods inherited from class java.lang.Object</B></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE>equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD>
</TR>
</TABLE>
<P>
<!-- ============ FIELD DETAIL =========== -->
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<A NAME="constructor_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TD>
</TR>
</TABLE>
<A NAME="VertexBuffer()"><!-- --></A><H3>
VertexBuffer</H3>
<PRE>
public <B>VertexBuffer</B>()</PRE>
<DL>
<DD><p>Constructs an empty vertex buffer, with all vertex attributes set to null. The default vertex color is initialized to 0xFFFFFFFF (opaque white). See the class description for information on how to fill in the attributes and what is the interpretation of null attributes.</p>
<P>
</DL>
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Method Detail</B></FONT></TD>
</TR>
</TABLE>
<A NAME="getVertexCount()"><!-- --></A><H3>
getVertexCount</H3>
<PRE>
public int <B>getVertexCount</B>()</PRE>
<DL>
<DD><p>Retrieves the current number of vertices in this VertexBuffer. This is the same as the number of vertices in any of the associated VertexArrays, because they must all have the same length. If there are no VertexArrays currently in this VertexBuffer, the number of vertices is defined to be zero.</p>
<P>
<DD><DL>
<DT><B>Returns:</B><DD>the number of vertices currently in this VertexBuffer, or zero if no vertex arrays are set</DL>
</DD>
</DL>
<HR>
<A NAME="setPositions(javax.microedition.m3g.VertexArray, float, float[])"><!-- --></A><H3>
setPositions</H3>
<PRE>
public void <B>setPositions</B>(<A HREF="../../../javax/microedition/m3g/VertexArray.html">VertexArray</A> positions, float scale, float[] bias)</PRE>
<DL>
<DD><p>Sets the vertex positions for this VertexBuffer. Vertex positions are specified with a 3-component VertexArray. The components are interpreted as coordinates in (X, Y, Z) order, each component being a signed 8-bit or 16-bit integer. Vertex positions have associated with them a uniform scale and a per-component bias, which are common to all vertices in the VertexArray. The final position <b>v'</b> of a vertex is computed from the original position <b>v</b> as follows:</p> <blockquote> <b>v'</b> = <i>s</i> <b>v</b> + <b>b</b> </blockquote> <p>where <i>s</i> is the the uniform scale and <b>b</b> is the bias vector. For example, the application can map the 8-bit integers [-128, 127] to the real number range [-1, 1] by setting the scale to 2/255 and the bias to 1/255.</p> <p>Non-uniform scaling is not supported due to implementation constraints. A uniform scale factor introduces no per-vertex processing overhead, as implementations may combine the scale with the transformation from object space to world space or camera space. Combining a non-uniform scale with that transformation, in contrast, would distort the normal vectors and thereby cause undesirable side effects in lighting.</p>
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>positions</CODE> - a VertexArray with 3-component vertex positions, or null to disable vertex positions<DD><CODE>scale</CODE> - a constant uniform scale factor common to all vertex positions<DD><CODE>bias</CODE> - a constant (X, Y, Z) offset to add to vertex positions after scaling, or null to set a zero bias for all components<DT><B>Throws:</B><DD><CODE>java.lang.IllegalArgumentException</CODE> - if <code>positions.numComponents != 3</code><DD><CODE>java.lang.IllegalArgumentException</CODE> - if <code>(positions.numVertices != getVertexCount) && (getVertexCount > 0)</code><DD><CODE>java.lang.IllegalArgumentException</CODE> - if <code>(positions != null) && (bias.length < 3)</code><DT><B>See Also:</B><DD><A HREF="../../../javax/microedition/m3g/VertexBuffer.html#getPositions(float[])"><CODE>getPositions</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="setTexCoords(int, javax.microedition.m3g.VertexArray, float, float[])"><!-- --></A><H3>
setTexCoords</H3>
<PRE>
public void <B>setTexCoords</B>(int index, <A HREF="../../../javax/microedition/m3g/VertexArray.html">VertexArray</A> texCoords, float scale, float[] bias)</PRE>
<DL>
<DD><p>Sets the texture coordinates for the specified texturing unit. Texture coordinates are specified with a 2- or 3-component VertexArray. The components are interpreted in (S, T) or (S, T, R) order, each component being a signed 8-bit or 16-bit integer. Texture coordinates have associated with them a uniform scale and a per-component bias, which behave exactly the same way as with vertex positions (see <code>setPositions</code>). Non-uniform scaling is not supported, so as to make texture coordinates behave consistently with vertex positions.</p>
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>index</CODE> - index of the texturing unit to assign these texture coordinates to<DD><CODE>texCoords</CODE> - a VertexArray with 2- or 3-component texture coordinates, or null to disable texture coordinates for the specified unit<DD><CODE>scale</CODE> - a constant uniform scale factor common to all texture coordinates<DD><CODE>bias</CODE> - a constant (X, Y, Z) offset to add to texture coordinates after scaling, or null to set a zero bias for all components<DT><B>Throws:</B><DD><CODE>java.lang.IllegalArgumentException</CODE> - if <code>texCoords.numComponents != [2,3]</code><DD><CODE>java.lang.IllegalArgumentException</CODE> - if <code>(texCoords.numVertices != getVertexCount) && (getVertexCount > 0)</code><DD><CODE>java.lang.IllegalArgumentException</CODE> - if <code>(texCoords != null) && (bias.length < texCoords.numComponents)</code><DD><CODE>java.lang.IndexOutOfBoundsException</CODE> - if <code>index != [0,N]</code> where <code>N</code> is the implementation specific maximum texturing unit index<DT><B>See Also:</B><DD><A HREF="../../../javax/microedition/m3g/VertexBuffer.html#getTexCoords(int, float[])"><CODE>getTexCoords</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="setNormals(javax.microedition.m3g.VertexArray)"><!-- --></A><H3>
setNormals</H3>
<PRE>
public void <B>setNormals</B>(<A HREF="../../../javax/microedition/m3g/VertexArray.html">VertexArray</A> normals)</PRE>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -