📄 polygonmode.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>
PolygonMode (Mobile 3D Graphics API (M3G))
</TITLE>
<META NAME="keywords" CONTENT="javax.microedition.m3g.PolygonMode,PolygonMode class">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
</HEAD>
<SCRIPT>
function asd()
{
parent.document.title="PolygonMode (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/PolygonMode.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/Object3D.html"><B>PREV CLASS</B></A>
<A HREF="../../../javax/microedition/m3g/RayIntersection.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="PolygonMode.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="#field_summary">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: <A HREF="#field_detail">FIELD</A> | <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 PolygonMode</H2>
<PRE>
java.lang.Object
|
+--<A HREF="../../../javax/microedition/m3g/Object3D.html">javax.microedition.m3g.Object3D</A>
|
+--<B>javax.microedition.m3g.PolygonMode</B>
</PRE>
<HR>
<DL>
<DT>public class <B>PolygonMode</B><DT>extends <A HREF="../../../javax/microedition/m3g/Object3D.html">Object3D</A></DL>
<P>
<p>An Appearance component encapsulating polygon-level attributes. Thisincludes settings related to back/front face culling, polygon winding,lighting computations, perspective correction, and shading.</p><p><i>Winding</i> specifies which side of a polygon is the front face.Winding can be set to either clockwise (CW) or counter-clockwise (CCW).If the screen-space vertices of a polygon are in the order specified bythe winding, then the polygon is front-facing. If the vertices are inthe reverse order, then the polygon is back-facing.</p><p><i>Culling</i> determines which side of a polygon is removed fromprocessing prior to rasterization: the back face, the front face, orneither. Culling both faces is not allowed, as there are many otherways to make a piece of geometry invisible.</p><p>Lighting may operate in either one-sided or two-sided mode. In<i>one-sided</i> mode, a single color is computed for each vertex,based on the vertex normal, light source parameters, and materialparameters. The same color is used in shading both the front faceand the back face of the polygon. In <i>two-sided</i> mode, thecolors for the back face of a polygon are computed separately andwith reversed normals (<b>n'</b> = <b>-n</b>). Regardless of thelighting mode, the same set of Material parameters is used for bothsides of the polygon. See the Material class description for moreinformation on lighting.</p><p>There are two choices for polygon <i>shading</i>, smooth and flat.Smooth shading means that a color is computed separately for each pixel.This may be done by linear interpolation between vertex colors (alsoknown as Gouraud shading), but implementations are also allowed tosubstitute a more accurate model. Flat shading means that the colorcomputed for the <i>third</i> vertex of a triangle is used across thewhole triangle.</p><p>If <i>local camera lighting</i> is disabled, the direction vectorfrom the camera to the vertex being lit is approximated with (0 0 -1).If local camera lighting is enabled, the direction is computed basedon the true camera position. This results in more accurate specularhighlights. Note that local camera lighting only has an effect on thespecular component of the lighting equation; the ambient and diffusecomponents remain unaffected. The local camera lighting flag is onlya hint, so some implementations may not respect it. The applicationmay use the <code>getProperties</code> method in Graphics3D to findout if the hint is supported.</p><p><i>Perspective correction</i> is a generic term for techniquesthat eliminate artifacts caused by the screen-space interpolationof texture coordinates, colors and fog. The lack of perspectivecorrection is especially evident on large textured polygons: thetexture is distorted and seems to "crawl" on the surface as theviewing angle changes.</p><p>The perspective correction flag is only a hint, so some implementationsmay not respect it. Also, no particular method of implementing it ismandated or preferred. For example, some implementations may choose todo perspective correction for texture coordinates only. The applicationmay use the <code>getProperties</code> method in Graphics3D to find outif the hint is supported.</p>
<P>
<P>
<DL>
<DT><B>See Also:</B><DD><a href="../../../file-format.html#PolygonMode">Binary format</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>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/m3g/PolygonMode.html#CULL_BACK">CULL_BACK</A></B></CODE>
<BR>
A parameter to <code>setCulling</code>, specifying that the back-facing side of a polygon is not to be drawn.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/m3g/PolygonMode.html#CULL_FRONT">CULL_FRONT</A></B></CODE>
<BR>
A parameter to <code>setCulling</code>, specifying that the front-facing side of a polygon is not to be drawn.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/m3g/PolygonMode.html#CULL_NONE">CULL_NONE</A></B></CODE>
<BR>
A parameter to <code>setCulling</code>, specifying that both faces of a polygon are to be drawn.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/m3g/PolygonMode.html#SHADE_FLAT">SHADE_FLAT</A></B></CODE>
<BR>
A parameter to <code>setShading</code>, specifying that flat shading is to be used.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/m3g/PolygonMode.html#SHADE_SMOOTH">SHADE_SMOOTH</A></B></CODE>
<BR>
A parameter to <code>setShading</code>, specifying that smooth shading is to be used.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/m3g/PolygonMode.html#WINDING_CCW">WINDING_CCW</A></B></CODE>
<BR>
A parameter to <code>setWinding</code>, specifying that a polygon having its vertices in counter-clockwise order in screen space is to be considered front-facing.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/m3g/PolygonMode.html#WINDING_CW">WINDING_CW</A></B></CODE>
<BR>
A parameter to <code>setWinding</code>, specifying that a polygon having its vertices in clockwise order in screen space is to be considered front-facing.</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>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -