📄 canvas3d.html
字号:
</ul> <p> The above callback methods are called by the Java 3D rendering system and should <i>not</i> be called by an application directly. <p> The basic Java 3D <i>stereo</i> rendering loop, executed for each Canvas3D, is as follows: <ul><pre> clear canvas (both eyes) call preRender() // user-supplied method set left eye view render opaque scene graph objects call renderField(FIELD_LEFT) // user-supplied method render transparent scene graph objects set right eye view render opaque scene graph objects again call renderField(FIELD_RIGHT) // user-supplied method render transparent scene graph objects again call postRender() // user-supplied method synchronize and swap buffers call postSwap() // user-supplied method </pre></ul> <p> The basic Java 3D <i>monoscopic</i> rendering loop is as follows: <ul><pre> clear canvas call preRender() // user-supplied method set view render opaque scene graph objects call renderField(FIELD_ALL) // user-supplied method render transparent scene graph objects call postRender() // user-supplied method synchronize and swap buffers call postSwap() // user-supplied method </pre></ul> <p> In both cases, the entire loop, beginning with clearing the canvas and ending with swapping the buffers, defines a frame. The application is given the opportunity to render immediate-mode geometry at any of the clearly identified spots in the rendering loop. A user specifies his or her own rendering methods by extending the Canvas3D class and overriding the preRender, postRender, postSwap, and/or renderField methods. Updates to live Geometry, Texture, and ImageComponent objects in the scene graph are not allowed from any of these callback methods. <p> <b>Serialization</b> <p> Canvas3D does <i>not</i> support serialization. An attempt to serialize a Canvas3D object will result in an UnsupportedOperationException being thrown. <p> <b>Additional Information</b> <p> For more information, see the <a href="doc-files/intro.html">Introduction to the Java 3D API</a> and <a href="doc-files/ViewModel.html">View Model</a> documents.<P><P><DL><DT><B>See Also:</B><DD><A HREF="../../../javax/media/j3d/Screen3D.html" title="class in javax.media.j3d"><CODE>Screen3D</CODE></A>, <A HREF="../../../javax/media/j3d/View.html" title="class in javax.media.j3d"><CODE>View</CODE></A>, <A HREF="../../../javax/media/j3d/GraphicsContext3D.html" title="class in javax.media.j3d"><CODE>GraphicsContext3D</CODE></A>, <A HREF="../../../serialized-form.html#javax.media.j3d.Canvas3D">Serialized Form</A></DL><HR><P><!-- ======== NESTED CLASS SUMMARY ======== --><A NAME="nested_class_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>Nested Class Summary</B></FONT></TH></TR></TABLE> <A NAME="nested_classes_inherited_from_class_java.awt.Canvas"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TH ALIGN="left"><B>Nested classes/interfaces inherited from class java.awt.Canvas</B></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE>java.awt.Canvas.AccessibleAWTCanvas</CODE></TD></TR></TABLE> <A NAME="nested_classes_inherited_from_class_java.awt.Component"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TH ALIGN="left"><B>Nested classes/interfaces inherited from class java.awt.Component</B></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE>java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy</CODE></TD></TR></TABLE> <!-- =========== 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="../../../javax/media/j3d/Canvas3D.html#FIELD_ALL">FIELD_ALL</A></B></CODE><BR> Specifies a single-field rendering loop.</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="../../../javax/media/j3d/Canvas3D.html#FIELD_LEFT">FIELD_LEFT</A></B></CODE><BR> Specifies the left field of a field-sequential stereo rendering loop.</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="../../../javax/media/j3d/Canvas3D.html#FIELD_RIGHT">FIELD_RIGHT</A></B></CODE><BR> Specifies the right field of a field-sequential stereo rendering loop.</TD></TR></TABLE> <A NAME="fields_inherited_from_class_java.awt.Component"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TH ALIGN="left"><B>Fields inherited from class java.awt.Component</B></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE>BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT</CODE></TD></TR></TABLE> <A NAME="fields_inherited_from_class_java.awt.image.ImageObserver"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TH ALIGN="left"><B>Fields inherited from interface java.awt.image.ImageObserver</B></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE>ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH</CODE></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="../../../javax/media/j3d/Canvas3D.html#Canvas3D(java.awt.GraphicsConfiguration)">Canvas3D</A></B>(java.awt.GraphicsConfiguration graphicsConfiguration)</CODE><BR> Constructs and initializes a new Canvas3D object that Java 3D can render into.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="../../../javax/media/j3d/Canvas3D.html#Canvas3D(java.awt.GraphicsConfiguration, boolean)">Canvas3D</A></B>(java.awt.GraphicsConfiguration graphicsConfiguration, boolean offScreen)</CODE><BR> Constructs and initializes a new Canvas3D object that Java 3D can render into.</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="../../../javax/media/j3d/Canvas3D.html#addNotify()">addNotify</A></B>()</CODE><BR> Canvas3D uses the addNotify callback to track when it is added to a container.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> java.awt.Rectangle</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/media/j3d/Canvas3D.html#getBounds()">getBounds</A></B>()</CODE><BR> </TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> java.awt.Rectangle</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/media/j3d/Canvas3D.html#getBounds(java.awt.Rectangle)">getBounds</A></B>(java.awt.Rectangle rv)</CODE><BR> </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="../../../javax/media/j3d/Canvas3D.html#getCenterEyeInImagePlate(javax.vecmath.Point3d)">getCenterEyeInImagePlate</A></B>(<A HREF="../../../javax/vecmath/Point3d.html" title="class in javax.vecmath">Point3d</A> position)</CODE><BR> Retrieves the actual position of the center eye in image-plate coordinates and copies that value into the object provided.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/media/j3d/Canvas3D.html#getDoubleBufferAvailable()">getDoubleBufferAvailable</A></B>()</CODE><BR> Returns a status flag indicating whether or not double buffering is available.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/media/j3d/Canvas3D.html#getDoubleBufferEnable()">getDoubleBufferEnable</A></B>()</CODE><BR> Returns a status flag indicating whether or not double buffering is enabled.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../../javax/media/j3d/J3DGraphics2D.html" title="class in javax.media.j3d">J3DGraphics2D</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/media/j3d/Canvas3D.html#getGraphics2D()">getGraphics2D</A></B>()</CODE><BR> Get the 2D graphics object associated with this Canvas3D.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../../javax/media/j3d/GraphicsContext3D.html" title="class in javax.media.j3d">GraphicsContext3D</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/media/j3d/Canvas3D.html#getGraphicsContext3D()">getGraphicsContext3D</A></B>()</CODE><BR> Get the immediate mode 3D graphics context associated with this Canvas3D.</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="../../../javax/media/j3d/Canvas3D.html#getHeight()">getHeight</A></B>()</CODE><BR> </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="../../../javax/media/j3d/Canvas3D.html#getImagePlateToVworld(javax.media.j3d.Transform3D)">getImagePlateToVworld</A></B>(<A HREF="../../../javax/media/j3d/Transform3D.html" title="class in javax.media.j3d">Transform3D</A> t)</CODE><BR> Retrieves the current ImagePlate coordinates to Virtual World coordinates transform and places it into the specified object.</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="../../../javax/media/j3d/Canvas3D.html#getInverseVworldProjection(javax.media.j3d.Transform3D, javax.media.j3d.Transform3D)">getInverseVworldProjection</A></B>(<A HREF="../../../javax/media/j3d/Transform3D.html" title="class in javax.media.j3d">Transform3D</A> leftInverseProjection, <A HREF="../../../javax/media/j3d/Transform3D.html" title="class in javax.media.j3d">Transform3D</A> rightInverseProjection)</CODE><BR> Copies the inverse of the current Vworld projection transform
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -