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

📄 canvas3d.html

📁 JAVA多媒体开发类库说明
💻 HTML
📖 第 1 页 / 共 5 页
字号:
<DT><B>Throws:</B><DD><CODE>java.lang.IllegalArgumentException</CODE> - if the specified GraphicsConfiguration does not support 3D rendering</DL></DL><HR><A NAME="Canvas3D(java.awt.GraphicsConfiguration, boolean)"><!-- --></A><H3>Canvas3D</H3><PRE>public <B>Canvas3D</B>(java.awt.GraphicsConfiguration&nbsp;graphicsConfiguration,                boolean&nbsp;offScreen)</PRE><DL><DD>Constructs and initializes a new Canvas3D object that Java 3D can render into.<P><DL><DT><B>Parameters:</B><DD><CODE>graphicsConfiguration</CODE> - a valid GraphicsConfiguration object that will be used to create the canvas.  This must be created either with a GraphicsConfigTemplate3D or by using the getPreferredConfiguration() method of the SimpleUniverse utility.<DD><CODE>offScreen</CODE> - a flag that indicates whether this canvas is an off-screen 3D rendering canvas.  Note that if offScreen is set to true, this Canvas3D object cannot be used for normal rendering; it should not be added to any Container object.<DT><B>Throws:</B><DD><CODE>java.lang.NullPointerException</CODE> - if the GraphicsConfiguration is null.<DD><CODE>java.lang.IllegalArgumentException</CODE> - if the specified GraphicsConfiguration does not support 3D rendering<DT><B>Since:</B></DT>  <DD>Java 3D 1.2</DD></DL></DL><!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"><B>Method Detail</B></FONT></TH></TR></TABLE><A NAME="paint(java.awt.Graphics)"><!-- --></A><H3>paint</H3><PRE>public void <B>paint</B>(java.awt.Graphics&nbsp;g)</PRE><DL><DD>Canvas3D uses the paint callback to track when it is possible to render into the canvas.  Subclasses of Canvas3D that override this method need to call super.paint() in their paint method for Java 3D to function properly.<P><DD><DL><DT><B>Overrides:</B><DD><CODE>paint</CODE> in class <CODE>java.awt.Canvas</CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>g</CODE> - the graphics context</DL></DD></DL><HR><A NAME="addNotify()"><!-- --></A><H3>addNotify</H3><PRE>public void <B>addNotify</B>()</PRE><DL><DD>Canvas3D uses the addNotify callback to track when it is added to a container.  Subclasses of Canvas3D that override this method need to call super.addNotify() in their addNotify() method for Java 3D to function properly.<P><DD><DL><DT><B>Overrides:</B><DD><CODE>addNotify</CODE> in class <CODE>java.awt.Canvas</CODE></DL></DD><DD><DL></DL></DD></DL><HR><A NAME="removeNotify()"><!-- --></A><H3>removeNotify</H3><PRE>public void <B>removeNotify</B>()</PRE><DL><DD>Canvas3D uses the removeNotify callback to track when it is removed from a container.  Subclasses of Canvas3D that override this method need to call super.removeNotify() in their removeNotify() method for Java 3D to function properly.<P><DD><DL><DT><B>Overrides:</B><DD><CODE>removeNotify</CODE> in class <CODE>java.awt.Component</CODE></DL></DD><DD><DL></DL></DD></DL><HR><A NAME="getScreen3D()"><!-- --></A><H3>getScreen3D</H3><PRE>public <A HREF="../../../javax/media/j3d/Screen3D.html" title="class in javax.media.j3d">Screen3D</A> <B>getScreen3D</B>()</PRE><DL><DD>Retrieve the Screen3D object that this Canvas3D is attached to. If this Canvas3D is an off-screen buffer, a new Screen3D object is created corresponding to the off-screen buffer.<P><DD><DL><DT><B>Returns:</B><DD>the 3D screen object that this Canvas3D is attached to</DL></DD></DL><HR><A NAME="getGraphicsContext3D()"><!-- --></A><H3>getGraphicsContext3D</H3><PRE>public <A HREF="../../../javax/media/j3d/GraphicsContext3D.html" title="class in javax.media.j3d">GraphicsContext3D</A> <B>getGraphicsContext3D</B>()</PRE><DL><DD>Get the immediate mode 3D graphics context associated with this Canvas3D.  A new graphics context object is created if one does not already exist.<P><DD><DL><DT><B>Returns:</B><DD>a GraphicsContext3D object that can be used for immediate mode rendering to this Canvas3D.</DL></DD></DL><HR><A NAME="getGraphics2D()"><!-- --></A><H3>getGraphics2D</H3><PRE>public <A HREF="../../../javax/media/j3d/J3DGraphics2D.html" title="class in javax.media.j3d">J3DGraphics2D</A> <B>getGraphics2D</B>()</PRE><DL><DD>Get the 2D graphics object associated with this Canvas3D.  A new 2D graphics object is created if one does not already exist.<P><DD><DL><DT><B>Returns:</B><DD>a Graphics2D object that can be used for Java 2D rendering into this Canvas3D.<DT><B>Since:</B></DT>  <DD>Java 3D 1.2</DD></DL></DD></DL><HR><A NAME="preRender()"><!-- --></A><H3>preRender</H3><PRE>public void <B>preRender</B>()</PRE><DL><DD>This routine is called by the Java 3D rendering loop after clearing the canvas and before any rendering has been done for this frame. Applications that wish to perform operations in the rendering loop, prior to any actual rendering may override this function. <p> Updates to live Geometry, Texture, and ImageComponent objects in the scene graph are not allowed from this method. <p> NOTE: Applications should <i>not</i> call this method.<P><DD><DL></DL></DD></DL><HR><A NAME="postRender()"><!-- --></A><H3>postRender</H3><PRE>public void <B>postRender</B>()</PRE><DL><DD>This routine is called by the Java 3D rendering loop after completing all rendering to the canvas for this frame and before the buffer swap. Applications that wish to perform operations in the rendering loop, following any actual rendering may override this function. <p> Updates to live Geometry, Texture, and ImageComponent objects in the scene graph are not allowed from this method. <p> NOTE: Applications should <i>not</i> call this method.<P><DD><DL></DL></DD></DL><HR><A NAME="postSwap()"><!-- --></A><H3>postSwap</H3><PRE>public void <B>postSwap</B>()</PRE><DL><DD>This routine is called by the Java 3D rendering loop after completing all rendering to the canvas, and all other canvases associated with this view, for this frame following the buffer swap. Applications that wish to perform operations at the very end of the rendering loop may override this function. In off-screen mode, all rendering is copied to the off-screen buffer before this method is called. <p> Updates to live Geometry, Texture, and ImageComponent objects in the scene graph are not allowed from this method. <p> NOTE: Applications should <i>not</i> call this method.<P><DD><DL></DL></DD></DL><HR><A NAME="renderField(int)"><!-- --></A><H3>renderField</H3><PRE>public void <B>renderField</B>(int&nbsp;fieldDesc)</PRE><DL><DD>This routine is called by the Java 3D rendering loop during the execution of the rendering loop.  It is called once for each field (i.e., once per frame on a mono system or once each for the right eye and left eye on a two-pass stereo system.  This is intended for use by applications that want to mix retained/compiled-retained mode rendering with some immediate mode rendering.  Applications that wish to perform operations during the rendering loop, may override this function. <p> Updates to live Geometry, Texture, and ImageComponent objects in the scene graph are not allowed from this method. <p> NOTE: Applications should <i>not</i> call this method. <p><P><DD><DL><DT><B>Parameters:</B><DD><CODE>fieldDesc</CODE> - field description, one of: FIELD_LEFT, FIELD_RIGHT or FIELD_ALL.  Applications that wish to work correctly in stereo mode should render the same image for both FIELD_LEFT and FIELD_RIGHT calls. If Java 3D calls the renderer with FIELD_ALL then the immediate mode rendering only needs to be done once.</DL></DD></DL><HR><A NAME="stopRenderer()"><!-- --></A><H3>stopRenderer</H3><PRE>public final void <B>stopRenderer</B>()</PRE><DL><DD>Stop the Java 3D renderer on this Canvas3D object.  If the Java 3D renderer is currently running, the rendering will be synchronized before being stopped.  No further rendering will be done to this canvas by Java 3D until the renderer is started again. In pure immediate mode this method should be called prior to adding this canvas to an active View object.<P><DD><DL><DT><B>Throws:</B><DD><CODE>java.lang.IllegalStateException</CODE> - if this Canvas3D is in off-screen mode.</DL></DD></DL><HR><A NAME="startRenderer()"><!-- --></A><H3>startRender

⌨️ 快捷键说明

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