Unidata - To provide the data services, tools, and cyberinfrastructure leadership that advance Earth system science, enhance educational opportunities, and broaden participation. Unidata
         
  advanced  
 

Re: Stereo Projection

Hi Kevin-

Kevin Manross wrote:

We're looking into trying out stereo projection, and I'm hoping my experience with VisAD will aid our group in that. I see in the email archives discussion on displaying stereo images. I've tried to run visad/examples/TestStereo.java, but get an error that reads:

[kmanross@lubbock examples]$ java -mx512m TestStereo
Unable to find a Stereo visual

At first, I thought it was looking for a stereo image as an input, but am beginning to think that it is looking for a display with stereo capabilities. Is this correct? Is there any tutorial on how to run (along with any potential hardware requirements) TestStereo.java?

It's looking for a stereo display.  In the code, it has:

    GraphicsConfigTemplate3D gct3d = new GraphicsConfigTemplate3D();
    gct3d.setStereo(GraphicsConfigTemplate3D.REQUIRED);

which requires a stereo visual.  For the IDV, we can use
a stereo config if one is available.  We have a method
for getting the graphics config to pass in to the DisplayImplJ3D
ctor:

    /**
     * Get graphics configuration for the screen
     *
     * @param d  the GraphicsDevice
     * @param is3D  true for a Java 3D display
     * @param useStereo true if a stereo display (is3D must also be true)
     *
     * @return the perferred config
     */
public static GraphicsConfiguration getPreferredConfig(GraphicsDevice d,
            boolean is3D, boolean useStereo) {
        try {
            if (d == null) {
                GraphicsEnvironment e
                    GraphicsEnvironment.getLocalGraphicsEnvironment();
                d = e.getDefaultScreenDevice();
            }
            GraphicsConfigTemplate template = null;
            if (is3D) {
                template = new GraphicsConfigTemplate3D();

                if (useStereo) {
                    ((GraphicsConfigTemplate3D) template).setStereo(
                        GraphicsConfigTemplate3D.PREFERRED);
                }
            }
            if (template == null) {
                return d.getDefaultConfiguration();
            } else {
                return d.getBestConfiguration(template);
            }
        } catch (HeadlessException he) {
            return null;
        }
    }

which will give us a stereo display if the graphics card
supports it (PREFERRED vs. REQUIRED).

There's no tutorial that I know of other than the Java 3D
FAQ:

http://java3d.j3d.org/faq/stereo.html

which is a bit out dated, but still relevant.

From our experiences, the thing we hear is "It's really cool,
but can you get the GUI to be 3D in addition to the display?"

Don
*************************************************************
Don Murray                               UCAR Unidata Program
dmurray@xxxxxxxxxxxxxxxx                        P.O. Box 3000
(303) 497-8628                              Boulder, CO 80307
http://www.unidata.ucar.edu/staff/donm
*************************************************************


==============================================================================
To unsubscribe visad, visit:
http://www.unidata.ucar.edu/mailing-list-delete-form.html
==============================================================================


 
 
  Contact Us     Site Map     Search     Terms and Conditions     Privacy Policy     Participation Policy
 
National Science Foundation (NSF) UCAR Community Programs   Unidata is a member of the UCAR Community Programs, is managed by the University Corporation for Atmospheric Research, and is sponsored by the National Science Foundation.
P.O. Box 3000     Boulder, CO 80307-3000 USA     Tel: 303-497-8643     Fax: 303-497-8690