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

📄 fog.html

📁 J2ME Mobile3D API,高性能手机3D开发的api
💻 HTML
📖 第 1 页 / 共 2 页
字号:
 <blockquote> f = e<sup>-dz</sup> </blockquote> <p>where z is the distance, in camera coordinates, from the camera origin to the fragment center, and d is the fog density set in <code>setDensity</code>. The result is clamped to the [0, 1] range.</p>
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#javax.microedition.m3g.Fog.EXPONENTIAL">Constant Field Values</A></DL>
</DL>
<HR>

<A NAME="LINEAR"><!-- --></A><H3>
LINEAR</H3>
<PRE>
public static final int <B>LINEAR</B></PRE>
<DL>
<DD><p>A parameter to <code>setMode</code>, specifying linear fog. The fog blending factor <i>f</i> is calculated according to the formula:</p>  <blockquote> f = (far - z) / (far - near) </blockquote> <p>where z is the distance, in camera coordinates, from the camera origin to the fragment center, and near and far are the distances set in <code>setLinear</code>. The result is clamped to the [0, 1] range. If far == near, that is, the far and near distances are equal, the result is undefined.</p> <p>The smaller the fog blending factor is, the more of the fog color is blended in to the rasterized fragment. The blending factor reaches its minimum at the far plane, and the maximum at the near plane.</p>
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#javax.microedition.m3g.Fog.LINEAR">Constant Field Values</A></DL>
</DL>

<!-- ========= 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="Fog()"><!-- --></A><H3>
Fog</H3>
<PRE>
public <B>Fog</B>()</PRE>
<DL>
<DD><p>Constructs a new Fog object with default values. The default values are:</p>  <ul> <li>mode : <code>LINEAR</code></li> <li>density : 1.0 (exponential fog only)</li> <li>near distance : 0.0 (linear fog only)</li> <li>far distance : 1.0 (linear fog only)</li> <li>color: 0x00000000</li> </ul>
<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="setMode(int)"><!-- --></A><H3>
setMode</H3>
<PRE>
public void <B>setMode</B>(int&nbsp;mode)</PRE>
<DL>
<DD><p>Sets the fog mode to either linear or exponential.</p>
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>mode</CODE> - the fog mode to set; one of the symbolic constants        listed above<DT><B>Throws:</B><DD><CODE>java.lang.IllegalArgumentException</CODE> - if <code>mode</code> is not         <code>LINEAR</code> or <code>EXPONENTIAL</code><DT><B>See Also:</B><DD><A HREF="../../../javax/microedition/m3g/Fog.html#getMode()"><CODE>getMode</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="getMode()"><!-- --></A><H3>
getMode</H3>
<PRE>
public int <B>getMode</B>()</PRE>
<DL>
<DD><p>Retrieves the current fog mode.</p>
<P>
<DD><DL>
<DT><B>Returns:</B><DD>the current fog mode; one of the symbolic constants listed above<DT><B>See Also:</B><DD><A HREF="../../../javax/microedition/m3g/Fog.html#setMode(int)"><CODE>setMode</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="setLinear(float, float)"><!-- --></A><H3>
setLinear</H3>
<PRE>
public void <B>setLinear</B>(float&nbsp;near,                      float&nbsp;far)</PRE>
<DL>
<DD><p>Sets the near and far distances for linear fog. Note that the near distance does not have to be smaller than the far distance, although that is usually the case.</p> <p>Note that this setting has no effect unless the type of this Fog is (or is later set to) <code>LINEAR</code>.</p>
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>near</CODE> - distance to the linear fog near plane<DD><CODE>far</CODE> - distance to the linear fog far plane</DL>
</DD>
</DL>
<HR>

<A NAME="getNearDistance()"><!-- --></A><H3>
getNearDistance</H3>
<PRE>
public float <B>getNearDistance</B>()</PRE>
<DL>
<DD><p>Retrieves the linear fog near distance.</p>
<P>
<DD><DL>
<DT><B>Returns:</B><DD>the current distance to the linear fog near plane<DT><B>See Also:</B><DD><A HREF="../../../javax/microedition/m3g/Fog.html#setLinear(float, float)"><CODE>setLinear</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="getFarDistance()"><!-- --></A><H3>
getFarDistance</H3>
<PRE>
public float <B>getFarDistance</B>()</PRE>
<DL>
<DD><p>Retrieves the linear fog far distance.</p>
<P>
<DD><DL>
<DT><B>Returns:</B><DD>the current distance to the linear fog far plane<DT><B>See Also:</B><DD><A HREF="../../../javax/microedition/m3g/Fog.html#setLinear(float, float)"><CODE>setLinear</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="setDensity(float)"><!-- --></A><H3>
setDensity</H3>
<PRE>
public void <B>setDensity</B>(float&nbsp;density)</PRE>
<DL>
<DD><p>Sets the fog density for exponential fog.</p> <p>Note that this setting has no effect unless the type of this Fog is (or is later set to) <code>EXPONENTIAL</code>.</p>
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>density</CODE> - the density to set for this Fog<DT><B>Throws:</B><DD><CODE>java.lang.IllegalArgumentException</CODE> - if <code>density &lt; 0</code><DT><B>See Also:</B><DD><A HREF="../../../javax/microedition/m3g/Fog.html#getDensity()"><CODE>getDensity</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="getDensity()"><!-- --></A><H3>
getDensity</H3>
<PRE>
public float <B>getDensity</B>()</PRE>
<DL>
<DD><p>Retrieves the fog density of exponential fog.</p>
<P>
<DD><DL>
<DT><B>Returns:</B><DD>the current density of this Fog<DT><B>See Also:</B><DD><A HREF="../../../javax/microedition/m3g/Fog.html#setDensity(float)"><CODE>setDensity</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="setColor(int)"><!-- --></A><H3>
setColor</H3>
<PRE>
public void <B>setColor</B>(int&nbsp;RGB)</PRE>
<DL>
<DD><p>Sets the color of this Fog. The high order byte of the color value (that is, the alpha component) is ignored.</p>
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>RGB</CODE> - the color to set for this Fog in 0x00RRGGBB format<DT><B>See Also:</B><DD><A HREF="../../../javax/microedition/m3g/Fog.html#getColor()"><CODE>getColor</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="getColor()"><!-- --></A><H3>
getColor</H3>
<PRE>
public int <B>getColor</B>()</PRE>
<DL>
<DD><p>Retrieves the current color of this Fog. The high order byte of the color value (that is, the alpha component) is guaranteed to be zero.</p>
<P>
<DD><DL>
<DT><B>Returns:</B><DD>the current color of this Fog in 0x00RRGGBB format<DT><B>See Also:</B><DD><A HREF="../../../javax/microedition/m3g/Fog.html#setColor(int)"><CODE>setColor</CODE></A></DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>

<!-- ========== START OF NAVBAR ========== -->
<A NAME="navbar_bottom"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
<TR>
<TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_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>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/Fog.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</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">
&nbsp;<A HREF="../../../javax/microedition/m3g/CompositingMode.html"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../javax/microedition/m3g/Graphics3D.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>  &nbsp;
&nbsp;<A HREF="Fog.html" TARGET="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<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:&nbsp;NESTED&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<!-- =========== END OF NAVBAR =========== -->

<HR>
<EM>Copyright &copy 2003 Nokia Corporation. See the <a href="../../../overview-summary.html#Copyright">Copyright Notice</a> for details.</EM>
</BODY>
</HTML>

⌨️ 快捷键说明

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