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

📄 light.html

📁 J2ME Mobile3D API,高性能手机3D开发的api
💻 HTML
📖 第 1 页 / 共 3 页
字号:
<!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>
Light (Mobile 3D Graphics API (M3G))
</TITLE>
<META NAME="keywords" CONTENT="javax.microedition.m3g.Light,Light class">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
</HEAD>
<SCRIPT>
function asd()
{
parent.document.title="Light (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>&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/Light.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/KeyframeSequence.html"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../javax/microedition/m3g/Loader.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="Light.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>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
javax.microedition.m3g</FONT>
<BR>
Class Light</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.Light</B>
</PRE>
<HR>
<DL>
<DT>public class <B>Light</B><DT>extends <A HREF="../../../javax/microedition/m3g/Node.html">Node</A></DL>

<P>
<p>A scene graph node that represents different kinds of light sources.</p><p>Light sources are used to determine the color of each object accordingto its Material attributes, as described in more detail in the <A HREF="../../../javax/microedition/m3g/Material.html">Material</A> class documentation.</p><h3>Light source types</h3><p>Four types of light sources are available. In the order of increasingcomputational complexity, these are the <i>ambient light</i>, <i>directionallight</i>, <i>omnidirectional light</i> and <i>spot light</i>. Theircharacteristics are described below.</p><ul><p><li>An <b>ambient</b> light source illuminates all objects in the scenefrom all directions. The intensity of light coming from an ambient lightsource is the same everywhere in the scene. The position and direction ofan ambient light source therefore have no effect.</li></p><p><li>A <b>directional</b> light source corresponds to sunlight in the realworld. It illuminates all objects in the scene from the same direction,and with a constant intensity. Similar to ambient light, the position ofa directional light source has no effect. The direction of the light isalong the negative Z axis of the Light node's local coordinate system.</li></p><p><li>An <b>omnidirectional</b> light source, also known as a <i>pointlight</i>, casts equal illumination in all directions from the origin ofthe Light node's local coordinate system. The intensity of light coming from an omnidirectional light source can be attenuated with distance. Theorientation of an omnidirectional Light node has no effect; only theposition matters.</li></p><p><li>A <b>spot</b> light source casts a cone of light centered around thedirection of its negative Z axis. The concentration of light within thecone can be adjusted with the spot exponent. The intensity of light comingfrom a spot light can be attenuated with distance from the source. Both theorientation and the position of the Light node have an effect with spotlights.</li></p></ul>         <p>The type of a light source can be changed at any time. This is usefulfor switching to a simpler lighting model when the distance to an objectincreases over a certain threshold, for example.</p><h3>Light color and intensity</h3><p>The RGB intensity contributed to the lighting calculation by a Lightis (IR, IG, IB), where I is the intensity of the Light and (R, G, B) isits color. Note that while 1.0 is a nominal full intensity, applicationsmay use values higher than that for more control over highlights, forexample. The intensity may also be set to negative to specify an"antilight" or "dark".</p><p>In the case of an ambient light source, the final RGB intensityrepresents the ambient color component only; the diffuse and specularcomponents are implicitly set to zero. In the case of a directional,omni or spot light, the final intensity represents both the diffuseand specular components, while the ambient component is correspondinglyset to zero.</p><h3>Light source selection</h3><p>The set of meshes affected by a Light can be limited using the scopeof the Light and each Mesh. A Light node is only included in the lightingcalculations for a mesh if the scope of the mesh matches the scope of theLight. See the <a href="Node.html#Scoping">Node</a> class description formore information.</p><p>Lights can be turned on and off using <A HREF="../../../javax/microedition/m3g/Node.html#setRenderingEnable(boolean)"><CODE>Node.setRenderingEnable(boolean)</CODE></A>.The corresponding picking enable flag has no effect, because Lights arealways ignored when picking.</p><h3>Implementation guidelines</h3><p>The number of Lights matching with a single Mesh may be greater than themaximum number of concurrent lights that the implementation can support (N).In this case, the implementation may choose any N lights, as long as theselection is deterministic. For best results, the implementation may usea suitable heuristic to select the N lights that have the most effect onthe rendered appearance of the mesh. The light selection may even be doneseparately for each submesh. The maximum number of concurrent lights canbe queried from <A HREF="../../../javax/microedition/m3g/Graphics3D.html#getProperties()"><CODE>getProperties</CODE></A>.</p>
<P>

<P>
<DL>
<DT><B>See Also:</B><DD><a href="../../../file-format.html#Light">Binary format</a>, <A HREF="../../../javax/microedition/m3g/Material.html"><CODE>Material</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>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/m3g/Light.html#AMBIENT">AMBIENT</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;A parameter to <code>setMode</code>, specifying an ambient light source.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/m3g/Light.html#DIRECTIONAL">DIRECTIONAL</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;A parameter to <code>setMode</code>, specifying a directional light source.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/m3g/Light.html#OMNI">OMNI</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;A parameter to <code>setMode</code>, specifying an omnidirectional light source.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/m3g/Light.html#SPOT">SPOT</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;A parameter to <code>setMode</code>, specifying a spot light source.</TD>
</TR>
</TABLE>
&nbsp;<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>
&nbsp;
<!-- ======== 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/Light.html#Light()">Light</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Constructs a new Light with default values. </TD>
</TR>
</TABLE>
&nbsp;
<!-- ========== 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>&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/m3g/Light.html#getColor()">getColor</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Retrieves the current color of this Light. </TD>
</TR>

⌨️ 快捷键说明

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