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

📄 config-syntax.html

📁 JAVA多媒体开发类库说明
💻 HTML
📖 第 1 页 / 共 5 页
字号:
</table><p>The sample configuration files are annotated to assist users in modifying themto suit their particular viewing environments, but it can be helpful to knowsome of the basics of the Java 3D view model that are relevant to writing aconfiguration file.  This overview should only be considered an informaladjunct to the detailed description in the Java 3D Specification.  Reading thesource code to the <a href="../ViewInfo.html">ViewInfo</a> utility (a publicimplementation of the Java 3D view model) may also be helpful in understandingthe details of the view model.</p><table border="1" cellpadding="3" cellspacing="0" width="100%"><tr bgcolor="#eeeeff"><td><b>The Camera View Model</b></font></td></tr></table><p>In the traditional camera model the camera or eyepoint is positioned andoriented with respect to the virtual world via a view transform.  Objectscontained within the field of view are projected onto an image plane, which isthen mapped onto a display surface, usually a window on a desktop displaysystem.  While the view direction and camera position can be freely orientedand placed anywhere in the virtual world, the projection is accomplished usinga static frustum defined by the field of view and a flat image plane centeredabout and normal to the view direction.</p><p>This model emulates a typical physical camera quite well, but there are manyviewing configurations that cannot be implemented using image planes that arefixed with respect to the view direction.  In a multiple screen environment theprojection frustum for each screen is skewed with respect to the image plane,based on the user's nominal viewing position.  Realistic stereo views on fixeddisplays use skewed projection frustums derived from the offsets of the twoeyes from the center of the image plane, while head tracking with fixeddisplays involves dynamically adjusting projection frustums in response tovarying eye positions relative to the image plane.</p><p>In a low-level API such as OpenGL these situations are handled by concatenatingall defined model and viewing transforms into a single <i>modelview matrix</i>,and for a fixed-screen environment explicitly computing the <i>projectionmatrix</i> for each eye, each display surface, and each new headposition.  Every application handling such viewing configurations typicallyreimplements the framework for computing those matrices itself.  In these casesit would be useful to be able to separate the projection components out of theview transform in some representation based on display and eye locations.</p><table border="1" cellpadding="3" cellspacing="0" width="100%"><tr bgcolor="#eeeeff"><td><b>The Java 3D View Model</b></font></td></tr></table><p>Based on these requirements, a high-level view model should provide standardmechanisms to 1) define a screen's position and orientation in relation toother screens in the viewing environment; 2) specify the position of the user'seyes or an HMD relative to the physical space in which the screens or nominaluser position are defined, and to have them updated automatically if trackinghardware exists; and 3) describe where the whole physical space is placed andoriented in the virtual world.  In such a model the appropriate images couldthen be rendered without further computation in application code.</p><p>In the Java 3D view model, screen <i>(image plate)</i> positions andorientations are defined relative to a fixed frame of reference in the physicalworld, the <i>tracker base</i>, through the<a href="#TrackerBaseToImagePlate">TrackerBaseToImagePlate</a> property.  Thetracker base is somewhat abstract in that it is always used to define thatfixed frame of reference, even if no physical tracking hardware is beingused.  If the <a href="#ViewPolicy">ViewPolicy</a> is HMD_VIEW, then the leftand right image plates for head mounted displays are defined relative to thehead tracking sensor, which reports head orientation and position relative tothe tracker base.</p><p><i>Coexistence coordinates</i> are defined with the <a href="#CoexistenceToTrackerBase">CoexistenceToTrackerBase</a> property.  Itprovides a frame of reference in the physical world which can be set up by theuser or application in whatever way is most convenient for positioning andorienting screens, physical body attributes, and sensing devices in the virtualworld.  If tracking is enabled, then the eye positions in coexistence arecomputed from the position and orientation of the head tracking sensor and the<a href="#HeadToHeadTracker">HeadToHeadTracker</a> matrix; otherwise the eyepositions in coexistence are set according to the <a href="#CenterEyeInCoexistence">CenterEyeInCoexistence</a> property.  In HMDmode the eye positions are fixed with respect to the image plates.</p><p>The mapping of coexistence coordinates into the virtual world is accomplishedthrough the <a href="#ViewAttachPolicy">ViewAttachPolicy</a>, which specifiesthe point in coexistence coordinates to which the origin of the <i>viewplatform</i> should be mapped.  The view platform is positioned in the virtualworld by manipulating its <i>view transform</i>, the composite of all thetransforms from the view platform up to its Locale.  The basis vectors (X, Y,and Z directions) of the view platform are always aligned with coexistencecoordinates, and the scaling between view platform coordinates and physicalcoordinates is specified by the <a href="#ScreenScalePolicy">ScreenScalePolicy</a>, so thisestablishes the complete mapping of the physical world into the virtual world.The projection of the virtual world onto the physical display surfaces is thenperformed automatically by the Java 3D renderer.</p><p>By default Java 3D tries to emulate the familiar camera model as much aspossible to make it easy to run in a conventional windowed desktop displayenvironment.  It accomplishes this through the following default settings:</p><ul><li><a href="#WindowEyepointPolicy">WindowEyepointPolicy</a> is set to<code>RELATIVE_TO_FIELD_OF_VIEW</code>.</li><li><a href="#WindowMovementPolicy">WindowMovementPolicy</a> is set to<code>PHYSICAL_WORLD</code>.</li><li><a href="#WindowResizePolicy">WindowResizePolicy</a> is set to<code>PHYSICAL_WORLD</code>.</li><li><a href="#ViewAttachPolicy">ViewAttachPolicy</a> is set to <code>NOMINAL_HEAD</code>.</li><li><a href="#CoexistenceCenteringEnable">CoexistenceCenteringEnable</a> is set totrue.</li></ul>When a configuration file is being used the defaults are oriented towardsmaking the setup of multiple screen environments as easy as possible.  If thecoexistence centering enable has not been explicitly set, and either theCoexistenceToTrackerBase transform for the view has been set orTrackerBaseToImagePlate has been set for any screen, then the followingdefaults are used instead:</p><ul><li><a href="#WindowEyepointPolicy">WindowEyepointPolicy</a> is set to<code>RELATIVE_TO_COEXISTENCE</code>.</li><li><a href="#WindowMovementPolicy">WindowMovementPolicy</a> is set to<code>VIRTUAL_WORLD</code>.</li><li><a href="#WindowResizePolicy">WindowResizePolicy</a> is set to<code>VIRTUAL_WORLD</code>.</li><li><a href="#ViewAttachPolicy">ViewAttachPolicy</a> is set to<code>NOMINAL_SCREEN</code>.</li><li><a href="#CoexistenceCenteringEnable">CoexistenceCenteringEnable</a> is set tofalse.</li></ul>The avove defaults are also used if coexistence centering enable has beenexplictly set false.<br><br><br><a name="TopLevelCommandDetails"></a><table border="1" cellpadding="3" cellspacing="0" width="100%"><tr bgcolor="#ccccff"><td><font size="+2"><b>Top-Level Command Details</b></font></td></tr></table><p>Top-level commands can only appear at the outermost command nesting level.</p><hr><h2><a NAME="NewDevice"></a>NewDevice</h2><b>Syntax:</b><br>(NewDevice <i>&lt;instance name&gt; &lt;class name&gt;</i>[Alias <i>&lt;alias name&gt;</i>])<p>This command instantiates the InputDevice implementation specified by the fullyqualified <i>class name</i> and binds it to <i>instance name</i>.  TheInputDevice is instantiated through introspection of the class name.  Theimplementation must provide a parameterless constructor; this can usually bedone by extending or wrapping available InputDevice implementations.</p><p>The last two arguments are optional and define an alias for <i>instancename</i>.  This is useful in providing a longer descriptive name for theapplication to recognize, or conversely, to provide a shorter alias for alonger instance name.  Either name may be used to identify the instance.</p><p>At the conclusion of configuration file processing all InputDeviceimplementations so defined will be initialized and registered with anyPhysicalEnvironments that reference them.<p><hr><h2><a NAME="DeviceProperty"></a>DeviceProperty</h2><b>Syntax:</b><br>(DeviceProperty <i>&lt;instance name&gt; &lt;method name&gt; &lt;arg0&gt; ... &lt;argn&gt;</i>)<p>The details of the InputDevice implementation specified by <i>instance name</i>are not known to ConfigContainer, so any parameters to be set through theconfiguration file are passed to the InputDevice instance by invoking <i>methodname</i> through introspection.  The arguments following the method name areevaluated and the results passed to the method as an array of Objects.</p><p>The required methods can usually be provided by extending or wrapping existingInputDevice implementations.</p><hr><h2><a NAME="NewSensor"></a>NewSensor</h2><b>Syntax:</b><br>(NewSensor <i>&lt;instance name&gt; &lt;device name&gt; &lt;sensor index&gt;</i> [Alias <i>&lt;alias name&gt;</i>])<p>Retrieves the Sensor at index <i>sensor index</i> in the InputDevice <i>devicename</i> and binds it to the name specified by <i>instance name</i>.  Thesensor index is a number truncated to its integer value.  The InputDeviceimplementation is responsible for creating its own Sensor objects, so thiscommand does not create any new instances.</p><p><i>Instance name</i> is used by other commands to reference the indicatedSensor.  In addition, the name and its associated Sensor instance is madeavailable to applications through a Map returned by the ConfigContainermethod <a href="../ConfigContainer.html#getNamedSensors()">getNamedSensors</a>.</p><p>The last two arguments are optional and define an alias for <i>instancename</i>.  This is useful in providing a longer descriptive name for theapplication to recognize, or conversely, to provide a shorter alias for alonger instance name.  Either name may be used to identify the instance.</p><p>If the Sensor is to be used for head tracking, or tracking the position andorientation of other objects in the physical world, then it must generate 6degree of freedom data relative to the tracker base.</p><hr><h2><a NAME="SensorProperty"></a>SensorProperty</h2><b>Syntax:</b><br>(SensorProperty <i>&lt;instance name&gt; &lt;property name&gt; &lt;property value&gt;</i>)<p>Sets a Sensor property.  The sensor instance is specified by <i>instancename</i>, the property to be set by <i>property name</i>, and the value to beset by <i>property value</i>.  The following sole property may beconfigured:</p><blockquote><h4><a NAME="Hotspot"></a>Hotspot</h4>A 3D point in the sensor's local coordinate system.  The hotspot specifies the"active" point which should interact with the virtual world, such as a pointused for picking or grabbing an object.  Its actual interpretation is up to thesensor behavior which uses it.  Its value is ignored for head tracking sensors.</blockquote><hr><h2><a NAME="NewScreen"></a>NewScreen<br><a NAME="NewWindow"></a>NewWindow</h2><b>Syntax:</b><br>(NewScreen <i>&lt;instance name&gt; &lt;device index&gt;</i>[Alias <i>&lt;alias name&gt;</i>])<br>(NewWindow <i>&lt;instance name&gt; &lt;device index&gt;</i>[Alias <i>&lt;alias name&gt;</i>])<p>The above two commands are equivalent.  Both create new window resources andassociate them with the name specified by <i>instance name</i>.  The <i>deviceindex</i> is a number truncated to its integer value.  This integer is theindex at which the desired AWT GraphicsDevice appears in the array returned bythe static getScreenDevices() method of GraphicsEnvironment, and specifies thephysical screen upon which the window should be created.  The GraphicsDeviceorder in the array is specific to the local viewing site and displaysystem.</p><p>The last two arguments are optional and define an alias for <i>instancename</i>.  This is useful in providing a longer descriptive name for the

⌨️ 快捷键说明

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