📄 viewmodel.html
字号:
position and orientation to that of a six-degrees-of-freedom trackingdevice. By slaving the frustum to the tracker, Java 3D canautomatically modify the view frustum so that the generated imagesmatch the end-user's viewpoint exactly.<p>Java 3D must handle two rather different head-trackingsituations.In one case, we rigidly attach a tracker's <em>base</em>,and thus its coordinate frame, to the display environment. Thiscorresponds to placing a tracker base in a fixed position andorientation relative to a projection screen within a room, to acomputer display on a desk, or to the walls of a multiple-wallprojection display. In the second head-tracking situation, we rigidlyattach a tracker's <em>sensor</em>, not its base, to the displaydevice. This corresponds to rigidly attaching one of that tracker'ssensors to a head-mounted display and placing the tracker basesomewhere within the physical environment.</p><p></p><h2>Physical Environments andTheir Effects</h2>Imagine an application where the end user sits on a magic carpet. Theapplication flies the user through the virtual environment bycontrolling the carpet's location and orientation within the virtualworld. At first glance, it might seem that the application alsocontrols what the end user will see-and it does, but onlysuperficially.<p>The following two examples show how end-user environments cansignificantly affect how an application must construct viewingtransformations.</p><p></p><h3>A Head-Mounted Example</h3>Imagine that the end user sees the magic carpet and the virtual worldwith a head-mounted display and head tracker. As the application fliesthe carpet through the virtual world, the user may turn to look to theleft, to the right, or even toward the rear of the carpet. Because thehead tracker keeps the renderer informed of the user's gaze direction,it might not need to draw the scene directly in front of the magiccarpet. The view that the renderer draws on the head-mount's displaymust match what the end user would see if the experience had occurredin the real world.<h3>A Room-Mounted Example</h3>Imagine a slightly different scenario where the end user sits in adarkened room in front of a large projection screen. The applicationstill controls the carpet's flight path; however, the position andorientation of the user's head barely influences the image drawn on theprojection screen. If a user looks left or right, then he or she seesonly the darkened room. The screen does not move. It's as if the screenrepresents the magic carpet's "front window" and the darkened roomrepresents the "dark interior" of the carpet.<p>By adding a left and right screen, we give the magic carpet rider amore complete view of the virtual world surrounding the carpet. Now ourend user sees the view to the left or right of the magic carpet byturning left or right.</p><p></p><h3>Impact of Head Position andOrientation on the Camera</h3>In the head-mounted example, the user's head position and orientationsignificantly affects a camera model's camera position and orientationbut hardly has any effect on the projection matrix. In the room-mountedexample, the user's head position and orientation contributes little toa camera model's camera position and orientation; however, it doesaffect the projection matrix.<p>From a camera-based perspective, the application developer mustconstruct the camera's position and orientation by combining thevirtual-world component (the position and orientation of the magiccarpet) and the physical-world component (the user's instantaneous headposition and orientation).</p><p>Java 3D's view model incorporates the appropriate abstractionstocompensate automatically for such variability in end-user hardwareenvironments.</p><p></p><h2>The Coordinate Systems</h2>The basic view model consists of eight or nine coordinate systems,depending on whether the end-user environment consists of aroom-mounted display or a head-mounted display. First, we define thecoordinate systems used in a room-mounted display environment. Next, wedefine the added coordinate system introduced when using a head-mounteddisplay system.<h3>Room-Mounted CoordinateSystems</h3>The room-mounted coordinate system is divided into the virtualcoordinate system and the physical coordinate system. <a href="#Figure_5">Figure5</a>shows these coordinate systems graphically. The coordinate systemswithin the grayed area exist in the virtual world; those outside existin the physical world. Note that the coexistence coordinate systemexists in both worlds.<h4>The Virtual CoordinateSystems</h4><h5> The Virtual World Coordinate System</h5>The virtual world coordinate system encapsulatesthe unified coordinate system for all scene graph objects in thevirtual environment. For a given View, the virtual world coordinatesystem is defined by the Locale object that contains the ViewPlatformobject attached to the View. It is a right-handed coordinate systemwith +<em>x</em> to the right, +<em>y</em> up, and +<em>z</em> towardthe viewer.<h5> The ViewPlatform Coordinate System</h5>The ViewPlatform coordinate system is the local coordinate system ofthe ViewPlatform leaf node to which the View is attached.<p><a name="Figure_5"></a><img style="width: 500px; height: 181px;" alt="Display Rigidly Attached to Tracker Base" title="Display Rigidly Attached to Tracker Base" src="ViewModel5.gif"></p><p></p><ul> <font size="-1"><b><i>Figure 5</i> – Display Rigidly Attached to theTracker Base</b></font></ul><p></p><h5> The Coexistence Coordinate System</h5>A primary implicit goal of any view model is to map a specified localportion of the physical world onto a specified portion of the virtualworld. Once established, one can legitimately ask where the user's heador hand is located within the virtual world or where a virtual objectis located in the local physical world. In this way the physical usercan interact with objects inhabiting the virtual world, and vice versa.To establish this mapping, Java 3D defines a special coordinatesystem,called coexistence coordinates, that is defined to exist in both thephysical world and the virtual world.<p>The coexistence coordinate system exists half in the virtual worldandhalf in the physical world. The two transforms that go from thecoexistence coordinate system to the virtual world coordinate systemand back again contain all the information needed to expand or shrinkthe virtual world relative to the physical world. It also contains theinformation needed to position and orient the virtual world relative tothe physical world.</p><p>Modifying the transform that maps the coexistence coordinate systeminto the virtual world coordinate system changes what the end user cansee. The Java 3D application programmer moves the end user withinthevirtual world by modifying this transform.</p><p></p><h4>The Physical CoordinateSystems</h4><h5> The Head Coordinate System</h5>The head coordinate system allows an application to import its user'shead geometry. The coordinate system provides a simple consistentcoordinate frame for specifying such factors as the location of theeyes and ears.<h5> The Image Plate Coordinate System</h5>The image plate coordinate system corresponds with the physicalcoordinate system of the image generator. The image plate is defined ashaving its origin at the lower left-hand corner of the display area andas lying in the display area's <em>XY</em>plane. Note that image plate is a different coordinate system thaneither left image plate or right image plate. These last two coordinatesystems are defined in head-mounted environments only.<h5> The Head Tracker Coordinate System</h5>The head tracker coordinate system corresponds to thesix-degrees-of-freedom tracker's sensor attached to the user's head.The head tracker's coordinate system describes the user's instantaneoushead position.<h5> The Tracker Base Coordinate System</h5>The tracker base coordinate system corresponds to the emitterassociated with absolute position/orientation trackers. For thosetrackers that generate relative position/orientation information, thiscoordinate system is that tracker's initial position and orientation.In general, this coordinate system is rigidly attached to the physicalworld.<h3>Head-Mounted CoordinateSystems</h3>Head-mounted coordinate systems divide the same virtual coordinatesystems and the physical coordinate systems. <a href="#Figure_6">Figure6</a>shows these coordinate systems graphically. As with the room-mountedcoordinate systems, the coordinate systems within the grayed area existin the virtual world; those outside exist in the physical world. Onceagain, the coexistence coordinate system exists in both worlds. Thearrangement of the coordinate system differs from those for aroom-mounted display environment. The head-mounted version ofJava 3D'scoordinate system differs in another way. It includes two image platecoordinate systems, one for each of an end-user's eyes.<h5> The Left Image Plate and Right Image Plate Coordinate Systems</h5>The left image plate and right image platecoordinate systems correspond with the physical coordinate system ofthe image generator associated with the left and right eye,respectively. The image plate is defined as having its origin at thelower left-hand corner of the display area and lying in the displayarea's <em>XY</em> plane. Note that the left image plate's <em>XY</em>plane does not necessarily lie parallel to the right image plate's <em>XY</em>plane. Note that the left image plate and the right image plate aredifferent coordinate systems than the room-mounted displayenvironment's image plate coordinate system.<p><a name="Figure_6"></a><img style="width: 499px; height: 162px;" alt="Display Rigidly Attached to Head Tracker" title="Display Rigidly Attached to Head Tracker" src="ViewModel6.gif"></p><p></p><ul> <font size="-1"><b><i>Figure 6</i> – Display Rigidly Attached to theHead Tracker (Sensor)</b></font></ul><p></p><h2>The Screen3D Object</h2>A Screen3D object represents one independent display device. The mostcommon environment for a Java 3D application is a desktop computerwithor without a head tracker. <a href="#Figure_7">Figure7</a> shows a scene graph fragment for a display environment designedfor such an end-user environment. <a href="#Figure_8">Figure8</a> shows a display environment that matches the scene graphfragment in <a href="#Figure_7">Figure7</a>.<p><a name="Figure_7"></a><img style="width: 499px; height: 185px;" alt="Environment with Single Screen3D Object" title="Environment with Single Screen3D Object" src="ViewModel7.gif"></p><p></p><ul> <font size="-1"><b><i>Figure 7</i> – A Portion of a Scene GraphContaining a Single Screen3DObject</b></font></ul><p><a name="Figure_8"></a><img style="width: 500px; height: 237px;" alt="Single-Screen Display Environment" title="Single-Screen Display Environment" src="ViewModel8.gif"></p><p></p><ul> <font size="-1"><b><i>Figure 8</i> – A Single-Screen DisplayEnvironment</b></font></ul><p>A multiple-projection wall display presents a more exotic environment.Such environments have multiple screens, typically three or more. <a href="#Figure_9">Figure9</a> shows a scene graph fragment representing such a system, and <a href="#Figure_10">Figure10</a> shows the corresponding display environment.</p><p><a name="Figure_9"></a><img style="width: 500px; height: 196px;" alt="Environment with Three Screen3D Object" title="Environment with Three Screen3D Object" src="ViewModel9.gif"></p><p></p><ul> <font size="-1"><b><i>Figure 9</i> – A Portion of a Scene GraphContaining Three Screen3DObjects</b></font></ul><p><a name="Figure_10"></a><img style="width: 700px; height: 241px;" alt="Three-Screen Display Environment" title="Three-Screen Display Environment" src="ViewModel10.gif"></p><p></p>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -