⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 vertexbuffer.html

📁 J2ME Mobile3D API,高性能手机3D开发的api
💻 HTML
📖 第 1 页 / 共 3 页
字号:
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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>&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/m3g/VertexBuffer.html#getVertexCount()">getVertexCount</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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>&nbsp;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>&nbsp;colors)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/m3g/VertexBuffer.html#setDefaultColor(int)">setDefaultColor</A></B>(int&nbsp;ARGB)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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>&nbsp;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>&nbsp;normals)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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>&nbsp;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>&nbsp;positions,             float&nbsp;scale,             float[]&nbsp;bias)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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>&nbsp;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&nbsp;index,             <A HREF="../../../javax/microedition/m3g/VertexArray.html">VertexArray</A>&nbsp;texCoords,             float&nbsp;scale,             float[]&nbsp;bias)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the texture coordinates for the specified texturing unit. </TD>
</TR>
</TABLE>
&nbsp;<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>
&nbsp;<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>
&nbsp;
<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>&nbsp;positions,                         float&nbsp;scale,                         float[]&nbsp;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 &gt; 0)</code><DD><CODE>java.lang.IllegalArgumentException</CODE> - if <code>(positions != null) &&         (bias.length &lt; 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&nbsp;index,                         <A HREF="../../../javax/microedition/m3g/VertexArray.html">VertexArray</A>&nbsp;texCoords,                         float&nbsp;scale,                         float[]&nbsp;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 &gt; 0)</code><DD><CODE>java.lang.IllegalArgumentException</CODE> - if <code>(texCoords != null) &&         (bias.length &lt; 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>&nbsp;normals)</PRE>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -