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

📄 canvas3d.html

📁 java 3d帮助文档
💻 HTML
📖 第 1 页 / 共 5 页
字号:
 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">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">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">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><DD>Java 3D 1.2</DD></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>startRenderer</H3><PRE>public final void <B>startRenderer</B>()</PRE><DL><DD>Start the Java 3D renderer on this Canvas3D object.  If the Java 3D renderer is not currently running, any rendering to other Canvas3D objects sharing the same View will be synchronized before this Canvas3D's renderer is (re)started.  When a Canvas3D is created, it is initially marked as being started.  This means that as soon as the Canvas3D is added to an active View object, the rendering loop will render the scene graph to the canvas.<P><DD><DL></DL></DD></DL><HR><A NAME="isRendererRunning()"><!-- --></A><H3>isRendererRunning</H3><PRE>public final boolean <B>isRendererRunning</B>()</PRE><DL><DD>Retrieves the state of the renderer for this Canvas3D object.<P><DD><DL><DT><B>Returns:</B><DD>the state of the renderer<DT><B>Since:</B><DD>Java 3D 1.2</DD></DD></DL></DD></DL><HR><A NAME="isOffScreen()"><!-- --></A><H3>isOffScreen</H3><PRE>public boolean <B>isOffScreen</B>()</PRE><DL><DD>Retrieves a flag indicating whether this Canvas3D is an off-screen canvas.<P><DD><DL><DT><B>Returns:</B><DD><code>true</code> if this Canvas3D is an off-screen canvas; <code>false</code> if this is an on-screen canvas.<DT><B>Since:</B><DD>Java 3D 1.2</DD></DD></DL></DD></DL><HR><A NAME="setOffScreenBuffer(javax.media.j3d.ImageComponent2D)"><!-- --></A><H3>setOffScreenBuffer</H3><PRE>public void <B>setOffScreenBuffer</B>(<A HREF="../../../javax/media/j3d/ImageComponent2D.html">ImageComponent2D</A>&nbsp;buffer)</PRE><DL><DD>Sets the off-screen buffer for this Canvas3D.  The specified image is written into by the Java 3D renderer.  The size of the specified ImageComponent determines the size, in pixels, of this Canvas3D--the size inherited from Component is ignored. <p> NOTE: the size, physical width, and physical height of the associated Screen3D must be set explicitly prior to rendering. Failure to do so will result in an exception. <p><P><DD><DL><DT><B>Parameters:</B><DD><CODE>buffer</CODE> - the image component that will be rendered into by subsequent calls to renderOffScreenBuffer.<DT><B>Throws:</B><DD><CODE>java.lang.IllegalStateException</CODE> - if this Canvas3D is not in off-screen mode.<DD><CODE><A HREF="../../../javax/media/j3d/RestrictedAccessException.html">RestrictedAccessException</A></CODE> - if an off-screen rendering is in process for this Canvas3D.<DD><CODE><A HREF="../../../javax/media/j3d/IllegalSharingException.html">IllegalSharingException</A></CODE> - if the specified ImageComponent2D is used by more than one Canvas3D.<DD><CODE>java.lang.IllegalArgumentException</CODE> - if the specified ImageComponent2D is in by-reference mode and its RenderedImage is not an instance of a BufferedImage or if the ImageComponent2D format is 

⌨️ 快捷键说明

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