![]() |
|
|||||||
| Development Help Help for building applications or diagnosing problems with WWJ |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Member
Join Date: Jul 2009
Posts: 30
![]() |
I've recently gone through the exercise of getting WWJ to work on a Samsung stereo TV (one with shutter glasses). Code is based on the WWJ Red/Blue anaglyph code and JOGL sample stereo code as a starting point. See: AnaglyphStereo.java in the WWJ distribution and JOGL demos.
For folks that want to get this working, here's what you need to do: 1) Ensure your video card supports 3D. If it does, then make sure support is turned on. NVIDIA has an entry in their control panel to do this - it is turned off by default. 2) Create a new canvas to replace WorldWindowGLCanvas. It is nearly identical to WorldWindowGLCanvas. Can't inherit from it due to the use of "private" for the "caps" field. The new canvas class (I use StereoWorldWindowGLCanvas as the name) needs to enable stereo in the caps: It needs to set the OpenGL chooser class to a custom one that looks for a 3D mode. Change the first line of the constructor from "super(caps)" to: Otherwise the constructor is the same as WorldWindowGLCanvas. The chooser can be added right into the StereoWorldWindowGLCanvas file, and would look like this (modify as needed): 3) You will need a new scene controller to render the two eyes. In worldwind.xml, add a reference to your new scene controller: The default value for the scene controller is BasicSceneController - just look for that and change it to your class name. I recommend modifying the code in "doRepaint()" where it does the Red/Blue drawing to use the quad-buffered mode like this: 4) Somewhere in your startup code, init() or the like, you need to build the canvas and set the intended display mode. Code will be like this: 5) Make sure display is in proper 3D mode to show alternating left/right frames. Left and right may need to be swapped depending on display versus graphics adapter notion of which frame belongs to which eye. Xander |
|
|
|
|
|
#2 |
|
Member
Join Date: Feb 2011
Posts: 45
![]() |
Would you mind posting the class in its entirety? This is really cool stuff, thanks!
EDIT: Nevermind, you have everything in very good detail that is needed. Thanks again! Last edited by robotfire; 03-03-2011 at 09:36 PM. |
|
|
|
|
|
#3 |
|
Guest
Posts: n/a
|
thanks for the info
|
|
|
|
#4 |
|
Member
Join Date: Feb 2011
Posts: 45
![]() |
Xander,
Could you tell me what video card you used and what model of TV? Also, are there any plans to build this capability directly into World Wind in a future release? Thanks! |
|
|
|
|
|
#5 |
|
Member
Join Date: Jul 2009
Posts: 30
![]() |
This is in answer to the last two posts...
The display is a Samsung 50" stereo display. The display board has a DVI out, from there is a DVI -> HDMI adapter and an HDMI cable to the screen. Really nothing special. Up to now on the PC I'm using to drive the screen, the only display adapters I have been able to use successfully have been NVIDIA based (I've tried three or four each of ATI and NVIDIA cards). However, it appears that ATI has made some driver updates that make now make it possible to drive OpenGL in the quad-buffer stereo mode. My MacBook also supports stereo output. You will be able to tell if the board/driver supports stereo without having the actual display - the mode will be available to the chooseCapabilities() method in the canvas. There's not really a lot special you have to do if the driver/control panel for the card has the 3D support. For the NVIDIA based boards there's a selection you need to turn on to enable stereo display (it doesn't appear if the board/driver doesn't support stereo). With the changes from private to protected in the Worldwind classes, the code to start things up is pretty small. I've attached everything you need for a simple applet: an applet that says it wants a stereo mode, a GLCanvas that has a chooser that looks for stereo, and a scene controller that draws to both back buffers. The canvas is a minor modification of the JOGL code for selecting a stereo mode. The controller is taken from the Red/Blue anaglyph controller in the Worldwind source code. I couldn't figure out how to ensure which of the buffers goes to left and right eyes. The display doesn't seem to be consistent. You may need to do what did and have an option to force the swap in code (the NVIDIA control panel has an option for that as well, but that's tedious to do every time you start your app). |
|
|
|
|
|
#6 |
|
weekend warrior
Join Date: May 2008
Posts: 95
![]() |
I earlier mentioned the unextensability of WWGLJPanel and WWGLCanvas in this thread http://forum.worldwindcentral.com/sh...ad.php?t=28846 but didn't get any traction. Perhaps someone at WorldWind will notice this and put a patch in place such that we can set custom GLCapabilities with our applications without duplicating the whole class?
|
|
|
|
|
|
#7 | |
|
Member
Join Date: Jul 2009
Posts: 30
![]() |
Quote:
|
|
|
|
|
|
|
#8 |
|
weekend warrior
Join Date: May 2008
Posts: 95
![]() |
I updated to the latest WorldWind jar and was able to easily switch to something which looks similar to what you posted. Not quite ideal, but much better!
|
|
|
|
|
|
#9 |
|
Member
Join Date: Feb 2011
Posts: 45
![]() |
So do a lot of cards have the capability to do this?
To get this working, I essentially take your source code and run it. That leaves one more tiny issue, which is in reference to editing worldwind.xml. Am I supposed to unzip worldwind.jar, edit that file, and zip it up again? You say: In worldwind.xml, add a reference to your new scene controller: <Property name="gov.nasa.worldwind.avkey.SceneCont rollerClassName" value="org.mycompany.worldwind.ColorSter eoSceneController"/> Thanks! |
|
|
|
|
|
#10 |
|
Junior Member
Join Date: Mar 2012
Posts: 22
![]() |
My main task is to " use a view model transform that would work with any pitch - instead of changing the heading". I want it steroe all the time and can't get the point why the heading only works with a certain range of pitch and why you chose it then? (It's also so in the AnaglyphSceneConrtolloer by PatMurris)..
Which view model transfrom you suggest that works with any pitch? Thank You |
|
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to setup WWJ | Hervé | Development Help | 96 | 03-04-2013 03:42 PM |
| 3D stereo anaglyph view for WWJ | patmurris | Development Help | 11 | 07-02-2012 01:03 PM |
| How to display 3D models on WWJ? | xuqingxin | Development Help | 7 | 12-29-2010 01:51 PM |
| display GEOTIFF files in WWJ | martin_ulmschneider | Development Help | 6 | 04-30-2009 09:10 AM |
| WWJ SDK Alpha 3 - 0.3.0 available | patmurris | WWJ Release Announcements | 35 | 12-03-2007 08:56 PM |