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

📄 pickintersection.html

📁 JAVA多媒体开发类库说明
💻 HTML
📖 第 1 页 / 共 3 页
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><!--NewPage--><HTML><HEAD><!-- Generated by javadoc (build 1.5.0_06) on Wed Dec 13 16:20:13 PST 2006 --><TITLE>PickIntersection (Java 3D 1.5.0)</TITLE><META NAME="keywords" CONTENT="com.sun.j3d.utils.picking.PickIntersection class"><LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style"><SCRIPT type="text/javascript">function windowTitle(){    parent.document.title="PickIntersection (Java 3D 1.5.0)";}</SCRIPT><NOSCRIPT></NOSCRIPT></HEAD><BODY BGCOLOR="white" onload="windowTitle();"><!-- ========= START OF TOP NAVBAR ======= --><A NAME="navbar_top"><!-- --></A><A HREF="#skip-navbar_top" title="Skip navigation links"></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_top_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">  <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="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-all.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></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">&nbsp;<A HREF="../../../../../com/sun/j3d/utils/picking/PickCanvas.html" title="class in com.sun.j3d.utils.picking"><B>PREV CLASS</B></A>&nbsp;&nbsp;<A HREF="../../../../../com/sun/j3d/utils/picking/PickResult.html" title="class in com.sun.j3d.utils.picking"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">  <A HREF="../../../../../index.html?com/sun/j3d/utils/picking/PickIntersection.html" target="_top"><B>FRAMES</B></A>  &nbsp;&nbsp;<A HREF="PickIntersection.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;&nbsp;<SCRIPT type="text/javascript">  <!--  if(window==top) {    document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>');  }  //--></SCRIPT><NOSCRIPT>  <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A></NOSCRIPT></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><A NAME="skip-navbar_top"></A><!-- ========= END OF TOP NAVBAR ========= --><HR><!-- ======== START OF CLASS DATA ======== --><H2><FONT SIZE="-1">com.sun.j3d.utils.picking</FONT><BR>Class PickIntersection</H2><PRE>java.lang.Object  <IMG SRC="../../../../../resources/inherit.gif" ALT="extended by "><B>com.sun.j3d.utils.picking.PickIntersection</B></PRE><HR><DL><DT><PRE>public class <B>PickIntersection</B><DT>extends java.lang.Object</DL></PRE><P>Holds information about an intersection of a PickShape with a Node  as part of a PickResult. Information about the intersected geometry, intersected primitive, intersection point, and  closest vertex can be inquired.   <p> The intersected geometry is indicated by an index into the list of  geometry arrays on the PickResult.  It can also be inquired from this object. <p> The intersected primitive indicates which primitive out of the GeometryArray was intersected (where the primitive is a point, line, triangle or quad,  not a <code>com.sun.j3d.utils.geometry.Primitive)</code>.   For example, the intersection would indicate which triangle out of a  triangle strip was intersected. The methods which return primitive data will have one value if the primitive  is a point, two values if the primitive is a line, three values if the primitive is a triangle and four values if the primitive is quad. <p> The primitive's VWorld coordinates are saved when then intersection is  calculated.  The local coordinates, normal, color and texture coordinates for the primitive can also be inquired if they are present and readable. <p> The intersection point is the location on the primitive which intersects the pick shape closest to the center of the pick shape. The intersection point's location in VWorld coordinates is saved when the intersection is calculated. The local coordinates, normal, color and texture coordiantes of at the intersection can be interpolated if they are present and readable. <p> The closest vertex is the vertex of the primitive closest to the intersection point.  The vertex index, VWorld coordinates and local coordinates of the  closest vertex can be inquired.  The normal, color and texture coordinate of the closest vertex can be inquired from the geometry array: <p><blockquote><pre>      Vector3f getNormal(PickIntersection pi, int vertexIndex) {          int index;          Vector3d normal = new Vector3f();          GeometryArray ga = pickIntersection.getGeometryArray();          if (pickIntersection.geometryIsIndexed()) {              index = ga.getNormalIndex(vertexIndex);          } else {              index = vertexIndex;          }          ga.getNormal(index, normal);          return normal;      } </pre></blockquote> <p> The color, normal and texture coordinate information for the intersected primitive and the  intersection point can be inquired the geometry includes them and the corresponding READ capibility bits are  set. <A HREF="PickTool.html#setCapabilities(javax.media.j3d.Node, int)"> <code>PickTool.setCapabilties(Node, int)</code></A>  can be used to set the capability bits to allow this data to be inquired.<P><P><HR><P><!-- ========== METHOD SUMMARY =========== --><A NAME="method_summary"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"><B>Method Summary</B></FONT></TH></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="../../../../../com/sun/j3d/utils/picking/PickIntersection.html#geometryIsIndexed()">geometryIsIndexed</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns true if the geometry is indexed</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../../../../javax/vecmath/Point3d.html" title="class in javax.vecmath">Point3d</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../com/sun/j3d/utils/picking/PickIntersection.html#getClosestVertexCoordinates()">getClosestVertexCoordinates</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Get coordinates of closest vertex (local)</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../../../../javax/vecmath/Point3d.html" title="class in javax.vecmath">Point3d</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../com/sun/j3d/utils/picking/PickIntersection.html#getClosestVertexCoordinatesVW()">getClosestVertexCoordinatesVW</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Get coordinates of closest vertex (world)</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="../../../../../com/sun/j3d/utils/picking/PickIntersection.html#getClosestVertexIndex()">getClosestVertexIndex</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Get index of closest vertex</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;double</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../com/sun/j3d/utils/picking/PickIntersection.html#getDistance()">getDistance</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Get the distance from the PickShape start point to the intersection point</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../../../../javax/media/j3d/GeometryArray.html" title="class in javax.media.j3d">GeometryArray</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../com/sun/j3d/utils/picking/PickIntersection.html#getGeometryArray()">getGeometryArray</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the GeometryArray for the intersection</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="../../../../../com/sun/j3d/utils/picking/PickIntersection.html#getGeometryArrayIndex()">getGeometryArrayIndex</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the index of the intersected GeometryArray into the geometry      arrays in the PickResult</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../../../../javax/vecmath/Color4f.html" title="class in javax.vecmath">Color4f</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../com/sun/j3d/utils/picking/PickIntersection.html#getPointColor()">getPointColor</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the color of the intersection point.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../../../../javax/vecmath/Point3d.html" title="class in javax.vecmath">Point3d</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../com/sun/j3d/utils/picking/PickIntersection.html#getPointCoordinates()">getPointCoordinates</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the coordinates of the intersection point (local coordinates),      if available.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../../../../javax/vecmath/Point3d.html" title="class in javax.vecmath">Point3d</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../com/sun/j3d/utils/picking/PickIntersection.html#getPointCoordinatesVW()">getPointCoordinatesVW</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the coordinates of the intersection point (world coordinates),       if available.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../../../../javax/vecmath/Vector3f.html" title="class in javax.vecmath">Vector3f</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../com/sun/j3d/utils/picking/PickIntersection.html#getPointNormal()">getPointNormal</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the normal of the intersection point.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">

⌨️ 快捷键说明

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