> Date: Mon, 28 Oct 2002 19:34:24 -0500 > From: Kit Fuhrman <[EMAIL PROTECTED]> > > I'm working on a research project that needs to implement Java3D into a > Head Mounted Projective Display(HMPD). In the HMPD there are two LCD, > one for each eye. The disparity between objects is used to give the > effect of depth. I have combed through the documentation a number of > times and have become confused over Java3D's implementation of stereo > viewing.
Your best bet is to try using the ConfiguredUniverse utility class available in Java 3D 1.3. Read the documentation available in "The Java 3D Configuration File" from the link referenced in the class overview for ConfiguredUniverse and try to get something working. Then, if ConfiguredUniverse doesn't fully meet your needs, set out to implement your application without using the utility. I'll try to answer some of your questions briefly below. > In my code I have two windows, each with a Canvas3D object. I use the > setMonoscopicViewPolicy(View.XXXXX_EYE_VIEW) to define which eye is > which. Then I use the physical body to set the inter-pupilary > distance. Will this work correctly? Yes, assuming everything else is specified correctly. If you're using a head tracker you'll also need to set HeadToHeadTracker appropriately. > Also the coordinates I set for the left and right eyes are supposedly > in meters, but it seems like that is too much of a disparity for > correct stereo viewing. Could this be a hardware issue or is their > something in the Java3D that I'm not grasping? All physical units in Java 3D are in meters for consistency. The typical interpupillary distance is about 0.066 meters. If this appears to create too much disparity, then some other aspect of the configuration is probably wrong. These might include the screen (ImagePlate) dimensions, positions & orientation, or perhaps the ScreenScale factor. > Also what is the setMonoscopicViewPolicy's relation to the method below? > java -Dj3d.stereo=PREFERRED HelloUniverse > What is the difference? Is one for shutter glasses and the other for > disparity left and right eye disparity viewing? Yes, that's right. The j3d.stereo property selects whether or not SimpleUniverse should try to get a stereo canvas. By "stereo canvas" we mean a canvas that supports quad buffering, i.e., a separate color buffer and depth buffer for each eye. These are then displayed in "field sequential" mode, so that the frame buffer for the right eye is displayed while the shutter glasses blank out the left eye and vice versa. This is the default CYCLOPEAN_EYE_VIEW policy. Unless you have a HMD that supports field-sequential stereo (the Sony LDI-D100B is the only one I've come across), you'll need two separate video streams generated by monoscopic canvases on separate screens for each eye, and setMonoscopicViewPolicy({LEFT,RIGHT}_EYE_VIEW) is exactly how you do that. You should create a full-screen Canvas3D for each physical screen, then configure the Screen3D parameters of each Canvas3D according to the optics of your head-mounted display. These would include PhysicalScreenWidth and PhysicalScreenHeight. Note, however, that for a HMD, these parameters refer to the *apparent* width and height of the screens as viewed through the HMD optics. So if the HMD manufacturer says you get a field of view of 60 degrees for each eye with a focal plane of 1 meter apparent distance, use those specifications to compute the screen width and height for each eye at the focal plane. You can't rely on the Java 3D default screen metrics (90 pixels/inch) for a HMD. You will also need to set HeadTrackerToLeftImagePlate and HeadTrackerToRightImagePlate for the appropriate Screen3D's, even if you don't use head tracking. Again, these are the *apparent* positions and orientations of the screens as viewed through the HMD optics, and must be computed from the manufacturer specifications. This allows Java 3D to compute the apparent orientation and position of each screen relative to the eye positions specified in the PhysicalBody. If you're not using head tracking, set HeadToHeadTracker to identity and then the HeadTrackerTo{Left,Right}ImagePlate transforms effectively become HeadTo{Left,Right}ImagePlate. The origin of the PhysicalBody frame of reference is the origin of "head" coordinates, which is the midpoint directly between the left and right eyes. Most HMD optics have 100% overlap between the left and right images, so the HeadTrackerTo{Left,Right}ImagePlate transforms should be the same. Finally, be sure to set the View's ViewPolicy to HMD_VIEW to switch the Java 3D viewing model from fixed-screen mode to head-mounted mode. > Would it be better for me to simply use two different view platforms > for the each eye? No, the view platform is part of the frame of reference in which both eye and screen positions are defined. When you move and orient the view platform, both eyes and screens move along with it in the virtual world. If you use head tracking, then head movements are effectively defined relative to the position and orientation of the view platform. > I've been working on this application for a while, and any help would > be great appreciated. HMD viewing is fairly complicated since it exposes a part of the Java 3D view model that most programmers don't need to worry too much about: the correspondence between the physical world and the virtual world. The physical metrics such as interpupilary distance, image plate dimensions, and the screen scaling are critical for success. Stereo disparity problems in particular are usually related to an inappropriate screen scale; the Java 3D default is set up for the typical desktop window environment, mapping the [-1.0 .. +1.0] range in virtual coordinates to the width of the Canvas3D. In monoscopic applications you can just move the view platform closer or further away and get an image of suitable scale, but in stereo you might wind up trying to converge your eyes on an object that's only an inch away from your nose in physical coordinates. You can set the screen scale explicitly by setting the View's ScreenScalePolicy to SCALE_EXPLICIT. Hope that helps for now -- Mark Hood =========================================================================== To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff JAVA3D-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".