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

📄 immediate.html

📁 JAVA多媒体开发类库说明
💻 HTML
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head>  <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type">  <title>Java 3D API - Immediate-Mode Rendering</title></head><body><h2>Immediate-Mode Rendering</h2><p>Java&nbsp;3D is fundamentally a scene graph-based API. Most ofthe constructs in the API are biased toward retained mode andcompiled-retained mode rendering. However, there are some applicationsthat want both the control and the flexibility that immediate-moderendering offers.</p><p>Immediate-mode applications can either use or ignore Java&nbsp;3D'sscenegraph structure. By using immediate mode, end-user applications havemore freedom, but this freedom comes at the expense of performance. Inimmediate mode, Java&nbsp;3D has no high-level information concerninggraphical objects or their composition. Because it has minimal globalknowledge, Java&nbsp;3D can perform only localized optimizations onbehalfof the application programmer.</p><p></p><h2>Two Styles of Immediate-ModeRendering</h2>Use of Java&nbsp;3D's immediate mode falls into one of two categories:pureimmediate-mode rendering and mixed-mode rendering in which immediatemode and retained or compiled-retained mode interoperate and render tothe same canvas. The Java&nbsp;3D renderer is idle in pure immediatemode,distinguishing it from mixed-mode rendering.<h3>Pure Immediate-ModeRendering</h3>Pure immediate-mode rendering provides for those applications andapplets that do not want Java&nbsp;3D to do any automatic rendering ofthescene graph. Such applications may not even wish to build a scene graphto represent their graphical data. However, they use Java&nbsp;3D'sattribute objects to set graphics state and Java&nbsp;3D's geometricobjectsto render geometry.<hr noshade="noshade"><b>Note:</b> Scene antialiasing is not supportedin pure immediate mode.<hr noshade="noshade">A pure immediate mode application must create aminimal set of Java&nbsp;3Dobjects before rendering. In addition to a Canvas3D object, theapplication must create a View object, with its associated PhysicalBodyand PhysicalEnvironment objects, and the following scene graphelements: a VirtualUniverse object, a high-resolution Locale object, aBranchGroup node object, a TransformGroup node object with associatedtransform, and, finally, a ViewPlatform leaf node object that definesthe position and orientation within the virtual universe that generatesthe view (see <a href="#Figure_1">Figure1</a>).<p><a name="Figure_1"></a><img style="width: 500px; height: 359px;" alt="Minimal Immediate-Mode Structure" title="Minimal Immediate-Mode Structure" src="Immediate1.gif"></p><p></p><ul>  <font size="-1"><b><i>Figure 1</i> &#8211; Minimal Immediate-Mode Structure</b></font></ul><p>Java&nbsp;3D provides utility functions that create much of thisstructureon behalf of a pure immediate-mode application, making it lessnoticeable from the application's perspective-but the structure mustexist.</p><p>All rendering is done completely under user control. It is necessaryfor the user to clear the 3D canvas, render all geometry, and swap thebuffers. Additionally, rendering the right and left eye for stereoviewing becomes the sole responsibility of the application.</p><p>In pure immediate mode, the user must stop the Java&nbsp;3Drenderer, viathe Canvas3D object <code>stopRenderer()</code>method, prior to adding the Canvas3D object to an active View object(that is, one that is attached to a live ViewPlatform object).</p><p></p><h3>Mixed-Mode Rendering</h3>Mixing immediate mode and retained or compiled-retained mode requiresmore structure than pure immediate mode. In mixed mode, theJava&nbsp;3Drenderer is running continuously, rendering the scene graph into thecanvas.<p>The basic Java&nbsp;3D <em>stereo</em> rendering loop, executed foreachCanvas3D, is as follows:</p><pre><hr><br>clear canvas (both eyes)<br></pre><pre>call preRender()                           <strong><kbd>// user-supplied method<br></kbd></strong>set left eye view<br>render opaque scene graph objects<br>call renderField(FIELD_LEFT)               <strong><kbd>// user-supplied method<br></kbd></strong>render transparent scene graph objects<br>set right eye view<br>render opaque scene graph objects again<br>call renderField(FIELD_RIGHT)              <strong><kbd>// user-supplied method<br></kbd></strong>render transparent scene graph objects again<br>call postRender()                          <strong><kbd>// user-supplied method<br></kbd></strong>synchronize and swap buffers<br></pre><pre>call postSwap()                            <strong><kbd>// user-supplied method<br></kbd></strong><br><hr></pre>The basic Java&nbsp;3D <em>monoscopic</em> rendering loop is asfollows:<pre><hr><br>clear canvas<br></pre><pre>call preRender()                            <strong><kbd>// user-supplied method<br></kbd></strong>set view<br>render opaque scene graph objects<br>call renderField(FIELD_ALL)                 <strong><kbd>// user-supplied method<br></kbd></strong>render transparent scene graph objects<br>call postRender()                           <strong><kbd>// user-supplied method<br></kbd></strong>synchronize and swap buffers<br></pre><pre>call postSwap()                             <strong><kbd>// user-supplied method<br></kbd></strong><br><hr></pre>In both cases, the entire loop, beginning with clearing the canvas andending with swapping the buffers, defines a frame. The application isgiven the opportunity to render immediate-mode geometry at any of theclearly identified spots in the rendering loop. A user specifies his orher own rendering methods by extending the Canvas3D class andoverriding the <code>preRender</code>, <code>postRender</code>, <code>postSwap</code>,and/or <code>renderField</code> methods.</body></html>

⌨️ 快捷键说明

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