📄 mesh.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN""http://www.w3.org/TR/REC-html40/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc on Thu Nov 27 13:54:35 EET 2003 -->
<META http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<TITLE>
Mesh (Mobile 3D Graphics API (M3G))
</TITLE>
<META NAME="keywords" CONTENT="javax.microedition.m3g.Mesh,Mesh class">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
</HEAD>
<SCRIPT>
function asd()
{
parent.document.title="Mesh (Mobile 3D Graphics API (M3G))";
}
</SCRIPT>
<BODY BGCOLOR="white" onload="asd();">
<!-- ========== START OF NAVBAR ========== -->
<A NAME="navbar_top"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
<TR>
<TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/Mesh.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
<EM><B>Nov 19, 2003</B></EM></EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../javax/microedition/m3g/Material.html"><B>PREV CLASS</B></A>
<A HREF="../../../javax/microedition/m3g/MorphingMesh.html"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../index.html" TARGET="_top"><B>FRAMES</B></A>
<A HREF="Mesh.html" TARGET="_top"><B>NO FRAMES</B></A>
<SCRIPT> <!-- if(window==top) { document.writeln('<A HREF="../../../allclasses-noframe.html" TARGET=""><B>All Classes</B></A>'); } //--></SCRIPT><NOSCRIPT><A HREF="../../../allclasses-noframe.html" TARGET=""><B>All Classes</B></A></NOSCRIPT></FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: NESTED | <A HREF="#fields_inherited_from_class_javax.microedition.m3g.Node">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<!-- =========== END OF NAVBAR =========== -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
javax.microedition.m3g</FONT>
<BR>
Class Mesh</H2>
<PRE>
java.lang.Object
|
+--<A HREF="../../../javax/microedition/m3g/Object3D.html">javax.microedition.m3g.Object3D</A>
|
+--<A HREF="../../../javax/microedition/m3g/Transformable.html">javax.microedition.m3g.Transformable</A>
|
+--<A HREF="../../../javax/microedition/m3g/Node.html">javax.microedition.m3g.Node</A>
|
+--<B>javax.microedition.m3g.Mesh</B>
</PRE>
<DL>
<DT><B>Direct Known Subclasses:</B> <DD><A HREF="../../../javax/microedition/m3g/MorphingMesh.html">MorphingMesh</A>, <A HREF="../../../javax/microedition/m3g/SkinnedMesh.html">SkinnedMesh</A></DD>
</DL>
<HR>
<DL>
<DT>public class <B>Mesh</B><DT>extends <A HREF="../../../javax/microedition/m3g/Node.html">Node</A></DL>
<P>
<p>A scene graph node that represents a 3D object defined as apolygonal surface.</p><p>This class represents a conventional rigid body mesh, whilethe derived classes MorphingMesh and SkinnedMesh extend it withcapabilities to transform vertices independently of each other.The structure of a basic Mesh is shown in the figure below.</p><center><img src="./doc-files/Mesh-components.png"/></center><p>A Mesh is composed of one or more submeshes and their associatedAppearances. A submesh is an array of triangle strips defined by anIndexBuffer object. The triangle strips are formed by indexing thevertex coordinates and other vertex attributes in an associatedVertexBuffer. All submeshes in a Mesh share the same VertexBuffer.However, in the case of a MorphingMesh, a weighted linear combinationof multiple VertexBuffers is used in place of a single VertexBuffer.</p><p>Submeshes within a Mesh are rendered in the order of ascendingAppearance layers, and such that opaque submeshes are rendered beforetransparent submeshes on the same layer. See the <A HREF="../../../javax/microedition/m3g/Appearance.html#setLayer(int)"><CODE>setLayer</CODE></A> method in Appearance for morediscussion on layered rendering.</p><p>Rendering and picking of a submesh is disabled if its Appearance isnull.</p><h3>Deferred exceptions</h3><p>An exception is thrown if the VertexBuffer or any of theIndexBuffers are in an invalid state when rendering or picking; seethe respective class descriptions for more information. Note that itwould be useless to check for these exception cases at constructiontime, because the application may freely change the contents of aVertexBuffer or an Appearance at any time. However, null IndexBuffersand VertexBuffers are blocked at the constructor, as usual, becausethe application is not able to change them afterwards.</p>
<P>
<P>
<DL>
<DT><B>See Also:</B><DD><a href="../../../file-format.html#Mesh">Binary format</a>, <A HREF="../../../javax/microedition/m3g/VertexBuffer.html"><CODE>VertexBuffer</CODE></A>, <A HREF="../../../javax/microedition/m3g/IndexBuffer.html"><CODE>IndexBuffer</CODE></A></DL>
<HR>
<P>
<!-- ======== NESTED CLASS SUMMARY ======== -->
<!-- =========== FIELD SUMMARY =========== -->
<A NAME="field_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Field Summary</B></FONT></TD>
</TR>
</TABLE>
<A NAME="fields_inherited_from_class_javax.microedition.m3g.Node"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TD><B>Fields inherited from class javax.microedition.m3g.<A HREF="../../../javax/microedition/m3g/Node.html">Node</A></B></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="../../../javax/microedition/m3g/Node.html#NONE">NONE</A>, <A HREF="../../../javax/microedition/m3g/Node.html#ORIGIN">ORIGIN</A>, <A HREF="../../../javax/microedition/m3g/Node.html#X_AXIS">X_AXIS</A>, <A HREF="../../../javax/microedition/m3g/Node.html#Y_AXIS">Y_AXIS</A>, <A HREF="../../../javax/microedition/m3g/Node.html#Z_AXIS">Z_AXIS</A></CODE></TD>
</TR>
</TABLE>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<A NAME="constructor_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../javax/microedition/m3g/Mesh.html#Mesh(javax.microedition.m3g.VertexBuffer, javax.microedition.m3g.IndexBuffer[], javax.microedition.m3g.Appearance[])">Mesh</A></B>(<A HREF="../../../javax/microedition/m3g/VertexBuffer.html">VertexBuffer</A> vertices, <A HREF="../../../javax/microedition/m3g/IndexBuffer.html">IndexBuffer</A>[] submeshes, <A HREF="../../../javax/microedition/m3g/Appearance.html">Appearance</A>[] appearances)</CODE>
<BR>
Constructs a new Mesh with the given VertexBuffer and submeshes. </TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../javax/microedition/m3g/Mesh.html#Mesh(javax.microedition.m3g.VertexBuffer, javax.microedition.m3g.IndexBuffer, javax.microedition.m3g.Appearance)">Mesh</A></B>(<A HREF="../../../javax/microedition/m3g/VertexBuffer.html">VertexBuffer</A> vertices, <A HREF="../../../javax/microedition/m3g/IndexBuffer.html">IndexBuffer</A> submesh, <A HREF="../../../javax/microedition/m3g/Appearance.html">Appearance</A> appearance)</CODE>
<BR>
Constructs a new Mesh consisting of only one submesh. </TD>
</TR>
</TABLE>
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Method Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../javax/microedition/m3g/Appearance.html">Appearance</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/m3g/Mesh.html#getAppearance(int)">getAppearance</A></B>(int index)</CODE>
<BR>
Gets the current Appearance of the specified submesh.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../javax/microedition/m3g/IndexBuffer.html">IndexBuffer</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/m3g/Mesh.html#getIndexBuffer(int)">getIndexBuffer</A></B>(int index)</CODE>
<BR>
Retrieves the submesh at the given index.</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/Mesh.html#getSubmeshCount()">getSubmeshCount</A></B>()</CODE>
<BR>
Gets the number of submeshes in this Mesh. </TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../javax/microedition/m3g/VertexBuffer.html">VertexBuffer</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/m3g/Mesh.html#getVertexBuffer()">getVertexBuffer</A></B>()</CODE>
<BR>
Gets the vertex buffer of this Mesh. </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/Mesh.html#setAppearance(int, javax.microedition.m3g.Appearance)">setAppearance</A></B>(int index, <A HREF="../../../javax/microedition/m3g/Appearance.html">Appearance</A> appearance)</CODE>
<BR>
Sets the Appearance for the specified submesh.</TD>
</TR>
</TABLE>
<A NAME="methods_inherited_from_class_javax.microedition.m3g.Node"><!-- --></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/Node.html">Node</A></B></TD>
</TR>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -