📄 geometryinfo.html
字号:
<!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:12 PST 2006 --><TITLE>GeometryInfo (Java 3D 1.5.0)</TITLE><META NAME="keywords" CONTENT="com.sun.j3d.utils.geometry.GeometryInfo class"><LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style"><SCRIPT type="text/javascript">function windowTitle(){ parent.document.title="GeometryInfo (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> </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="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-all.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></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../com/sun/j3d/utils/geometry/Cylinder.html" title="class in com.sun.j3d.utils.geometry"><B>PREV CLASS</B></A> <A HREF="../../../../../com/sun/j3d/utils/geometry/NormalGenerator.html" title="class in com.sun.j3d.utils.geometry"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../index.html?com/sun/j3d/utils/geometry/GeometryInfo.html" target="_top"><B>FRAMES</B></A> <A HREF="GeometryInfo.html" target="_top"><B>NO FRAMES</B></A> <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: 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><A NAME="skip-navbar_top"></A><!-- ========= END OF TOP NAVBAR ========= --><HR><!-- ======== START OF CLASS DATA ======== --><H2><FONT SIZE="-1">com.sun.j3d.utils.geometry</FONT><BR>Class GeometryInfo</H2><PRE>java.lang.Object <IMG SRC="../../../../../resources/inherit.gif" ALT="extended by "><B>com.sun.j3d.utils.geometry.GeometryInfo</B></PRE><HR><DL><DT><PRE>public class <B>GeometryInfo</B><DT>extends java.lang.Object</DL></PRE><P>The GeometryInfo object holds data for processing by the Java3D geometry utility tools.<p><blockquote> The NormalGenerator adds normals to geometry without normals.<p> The Stripifier combines adjacent triangles into triangle strips for more efficent rendering.<p></blockquote> Also, the GeometryCompressor can take a set of GeometryInfo objects in a CompressionSteam and generate a CompressedGeometry object from the geometry.<p> Geometry is loaded into a GeometryInfo in a manner similar to the <a href="../../../../../javax/media/j3d/GeometryArray.html"> GeometryArray</a> methods. The constructor for the GeometryInfo takes a flag that specifies the kind of data being loaded. The vertex data is specified using methods that are similar to the GeometryArray methods, but with fewer variations.<p> The major difference between GeometryInfo and GeometryArray is that the number of vertices, vertex format, and other data are specified implictly, rather than as part of the constructor. The number of verticies comes from the number of coordinates passed to the setCoordinates() method. The format comes from the set of data components that are specified. For example, calling the setCoordinates(), setColors3() and setTextureCoordinatesParames(1, 2) methods implies a format of COORDINATES | COLOR_3 | TEXTURE_COORDINATE_2. Indexed representation is specified by calling the methods that specify the indices, for example setCoordinateIndices().<p> Stripped primitives are loaded using the TRIANGLE_FAN_ARRAY or TRIANGLE_STRIP_ARRAY flags to the constructor. The setStripCounts() method specifies the length of each strip.<p> A set of complex polygons is loaded using the POLYGON_ARRAY flag to the constructor. The setStripCounts() method specifies the length of each contour of the polygons. The setContourCounts() method specifies the number of countours in each polygon. For example, a triangle with a triangular hole would have strip counts [3, 3] (indicating two contours of three points) and contour counts [2] (indicating a single polygon with two contours).<p> GeometryInfo itelf contains some simple utilities, such as calculating indices for non-indexed data ("indexifying") and getting rid of unused data in your indexed geometry ("compacting").<p> The geometry utility tools modify the contents of the GeometryInfo. After processing, the resulting geometry can be extracted from the GeometryInfo by calling getGeometryArray(). If multiple tools are used, the order of processing should be: generate normals, then stripify. For example, to convert a general mesh of polygons without normals into an optimized mesh call: <pre><blockquote> GeometryInfo gi = new GeometryInfo(GeometryInfo.POLYGON_ARRAY); // initialize the geometry info here // generate normals NormalGenerator ng = new NormalGenerator(); ng.generateNormals(gi); // stripify Stripifier st = new Stripifier(); st.stripify(gi); GeometryArray result = gi.getGeometryArray(); </blockquote></pre><P><P><DL><DT><B>See Also:</B><DD><A HREF="../../../../../com/sun/j3d/utils/geometry/NormalGenerator.html" title="class in com.sun.j3d.utils.geometry"><CODE>NormalGenerator</CODE></A>, <A HREF="../../../../../com/sun/j3d/utils/geometry/Stripifier.html" title="class in com.sun.j3d.utils.geometry"><CODE>Stripifier</CODE></A>, <A HREF="../../../../../com/sun/j3d/utils/compression/CompressionStream.html" title="class in com.sun.j3d.utils.compression"><CODE>CompressionStream</CODE></A>, <A HREF="../../../../../com/sun/j3d/utils/compression/GeometryCompressor.html" title="class in com.sun.j3d.utils.compression"><CODE>GeometryCompressor</CODE></A>, <A HREF="../../../../../javax/media/j3d/GeometryArray.html" title="class in javax.media.j3d"><CODE>GeometryArray</CODE></A></DL><HR><P><!-- =========== FIELD SUMMARY =========== --><A NAME="field_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>Field Summary</B></FONT></TH></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="../../../../../com/sun/j3d/utils/geometry/GeometryInfo.html#POLYGON_ARRAY">POLYGON_ARRAY</A></B></CODE><BR> Send to the constructor to inform that the data is arranged as possibly multi-contour, possible non-planar polygons.</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="../../../../../com/sun/j3d/utils/geometry/GeometryInfo.html#QUAD_ARRAY">QUAD_ARRAY</A></B></CODE><BR> Send to the constructor to inform that the data will be arranged so that each set of four vertices form an independent quad</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="../../../../../com/sun/j3d/utils/geometry/GeometryInfo.html#TRIANGLE_ARRAY">TRIANGLE_ARRAY</A></B></CODE><BR> Send to the constructor to inform that the data will be arranged so that each set of three vertices form an independent triangle</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="../../../../../com/sun/j3d/utils/geometry/GeometryInfo.html#TRIANGLE_FAN_ARRAY">TRIANGLE_FAN_ARRAY</A></B></CODE><BR> Send to the constructor to inform that the data will be arranged so that the stripCounts array indicates how many vertices to use for each triangle fan.</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="../../../../../com/sun/j3d/utils/geometry/GeometryInfo.html#TRIANGLE_STRIP_ARRAY">TRIANGLE_STRIP_ARRAY</A></B></CODE><BR> Send to the constructor to inform that the data will be arranged so that the stripCounts array indicates how many vertices to use for each triangle strip.</TD></TR></TABLE> <!-- ======== CONSTRUCTOR SUMMARY ======== --><A NAME="constructor_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>Constructor Summary</B></FONT></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="../../../../../com/sun/j3d/utils/geometry/GeometryInfo.html#GeometryInfo(javax.media.j3d.GeometryArray)">GeometryInfo</A></B>(<A HREF="../../../../../javax/media/j3d/GeometryArray.html" title="class in javax.media.j3d">GeometryArray</A> ga)</CODE><BR> Contructor.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="../../../../../com/sun/j3d/utils/geometry/GeometryInfo.html#GeometryInfo(int)">GeometryInfo</A></B>(int primitive)</CODE><BR> Constructor.</TD></TR></TABLE> <!-- ========== 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> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../com/sun/j3d/utils/geometry/GeometryInfo.html#compact()">compact</A></B>()</CODE><BR> Remove unused data from an indexed dataset.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../com/sun/j3d/utils/geometry/GeometryInfo.html#convertToIndexedTriangles()">convertToIndexedTriangles</A></B>()</CODE><BR> Convert the GeometryInfo object to have primitive type TRIANGLE_ARRAY and be indexed.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> int[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../com/sun/j3d/utils/geometry/GeometryInfo.html#getColorIndices()">getColorIndices</A></B>()</CODE><BR> Retrieves a reference to the array of indices into the color array.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> java.lang.Object[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../com/sun/j3d/utils/geometry/GeometryInfo.html#getColors()">getColors</A></B>()</CODE><BR> Retrieves a reference to the colors array.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> int[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../com/sun/j3d/utils/geometry/GeometryInfo.html#getContourCounts()">getContourCounts</A></B>()</CODE><BR> Retrieves a reference to the array of contourCounts.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> int[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../com/sun/j3d/utils/geometry/GeometryInfo.html#getCoordinateIndices()">getCoordinateIndices</A></B>()</CODE><BR> Retrieves a reference to the array of indices into the coordinate array.</TD>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -