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

📄 node.html

📁 J2ME Mobile3D API,高性能手机3D开发的api
💻 HTML
📖 第 1 页 / 共 4 页
字号:
<p><li><b>Picking.</b> The scope of the pick ray is given as a parameter tothe <code>pick</code> methods in Group. Again, only those objects can bepicked that are in the same scope as the pick ray; the others areignored.</li></p></ul><p>The default scope is -1, implying that all nodes are in the same scope.By default, all objects are therefore visible to all cameras, and are litby all light sources.</p><h3><a name="Instantiation">Instantiation</a></h3><p>Node is an abstract class, and therefore has no public constructor.When a class derived from Node is instantiated, the attributes definedin Node will have the following default values:</p><ul><li>parent node : null</li><li>rendering enable : <i>true</i></li><li>picking enable : <i>true</i></li><li>alpha factor : 1.0</li><li>alignment : none</li><li>scope : -1</li></ul><h3>Implementation guidelines</h3><p>The alignment rotation <b>A</b> is computed relative to the initialcoordinate system A defined by the <b>T</b> component of the nodetransformation alone. All other transformation components of the nodebeing aligned are ignored.</p><p>Conceptually, alignment is composed of two cumulative rotations:the shortest rotation <b>R</b><sub>z</sub> that takes the initial Zaxis to the Z alignment target vector, followed by the rotation<b>R</b><sub>y</sub> about the resulting Z vector that minimizes theangle between the resulting Y axis and the Y alignment target vector.If alignment is set for one axis only, that rotation is performed likethe initial Z rotation.</p><p>Formally, let us denote by <b>t</b><sub>Z</sub> and<b>t</b><sub>Y</sub> the Z and Y alignment target vectors, transformedfrom their respective reference nodes to A; note that axis targetstransform as vectors, and origin targets as points. The axis for thefirst rotation <b>R</b><sub>z</sub> is then the cross product of thelocal Z axis of A and the target vector:</p><blockquote><b>a</b><sub>Z</sub> = (0 0 1)<sup>T</sup> &times; <b>t</b><sub>Z</sub></blockquote><p>and the rotation angle can be computed via the dot product of thetwo. Rotating by <b>R</b><sub>z</sub> takes us to a new coordinate frameB where <b>t</b><sub>Y</sub> is expressed as:</p><blockquote><b>t</b><sub>Y</sub>' = <b>R</b><sub>Z</sub><sup>-1</sup> &times;                        <b>t</b><sub>Y</sub></blockquote><p>The axis for the second rotation <b>R</b><sub>Y</sub> is the localZ axis of B, and the angle is the angle between the local Y axis andthe projection of <b>t</b><sub>Y</sub>' on the XY plane.  The finalalignment rotation <b>A</b> is then:</p><blockquote><b>A</b> = <b>R</b><sub>Z</sub> <b>R</b><sub>Y</sub></blockquote><p>There are two cases where a rotation axis is undefined. Firstly, ifeither target vector coincides with the axis that it is a target for,the respective rotation must be substituted with an identity rotation.Secondly, if the target vector and the axis are opposite, the exactrotation path (that is, the resultant direction of the other two axes)is implementation dependent, but must be deterministic. Note that thelatter only matters for unconstrained (single-axis) alignment.</p>
<P>

<P>
<DL>
<DT><B>See Also:</B><DD><a href="../../../file-format.html#Node">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&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/m3g/Node.html#NONE">NONE</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Specifies for the <code>setAlignment</code> method that no alignment should be done for the specified axis.</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/Node.html#ORIGIN">ORIGIN</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Specifies the origin of the reference node as an orientation  reference for the <code>setAlignment</code> method.</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/Node.html#X_AXIS">X_AXIS</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Specifies the X axis of the reference node as an orientation reference for the <code>setAlignment</code> method.</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/Node.html#Y_AXIS">Y_AXIS</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Specifies the Y axis of the reference node as an orientation reference for the <code>setAlignment</code> method.</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/Node.html#Z_AXIS">Z_AXIS</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Specifies the Z axis of the reference node as an orientation reference for the <code>setAlignment</code> method.</TD>
</TR>
</TABLE>
&nbsp;
<!-- ======== CONSTRUCTOR SUMMARY ======== -->


<!-- ========== 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;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/m3g/Node.html#align(javax.microedition.m3g.Node)">align</A></B>(<A HREF="../../../javax/microedition/m3g/Node.html">Node</A>&nbsp;reference)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Applies alignments to this Node and its descendants.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;float</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/m3g/Node.html#getAlphaFactor()">getAlphaFactor</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Retrieves the alpha factor of this Node. </TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../javax/microedition/m3g/Node.html">Node</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/m3g/Node.html#getParent()">getParent</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the scene graph parent of this node.</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/Node.html#getScope()">getScope</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Retrieves the scope of this Node.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/m3g/Node.html#getTransformTo(javax.microedition.m3g.Node, javax.microedition.m3g.Transform)">getTransformTo</A></B>(<A HREF="../../../javax/microedition/m3g/Node.html">Node</A>&nbsp;target,               <A HREF="../../../javax/microedition/m3g/Transform.html">Transform</A>&nbsp;transform)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Gets the composite transformation from this node to the given node. </TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/m3g/Node.html#isPickingEnabled()">isPickingEnabled</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Retrieves the picking enable flag of this Node. </TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/m3g/Node.html#isRenderingEnabled()">isRenderingEnabled</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Retrieves the rendering enable flag of this Node. </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/Node.html#setAlignment(javax.microedition.m3g.Node, int, javax.microedition.m3g.Node, int)">setAlignment</A></B>(<A HREF="../../../javax/microedition/m3g/Node.html">Node</A>&nbsp;zRef,             int&nbsp;zTarget,             <A HREF="../../../javax/microedition/m3g/Node.html">Node</A>&nbsp;yRef,             int&nbsp;yTarget)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets this node to align with the given other node(s), or disables alignment. </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/Node.html#setAlphaFactor(float)">setAlphaFactor</A></B>(float&nbsp;alphaFactor)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the alpha factor for this Node. </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/Node.html#setPickingEnable(boolean)">setPickingEnable</A></B>(boolean&nbsp;enable)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the picking enable flag of this Node. </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/Node.html#setRenderingEnable(boolean)">setRenderingEnable</A></B>(boolean&nbsp;enable)</CODE>

⌨️ 快捷键说明

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