Anaglyph (3D): Difference between revisions

Jump to navigation Jump to search
Added Mac OS X implementation, explanation of variables,new screenshots for ver/hor modes, warning for use of glasses.
m (small wiki-styling/enhancements. Great article already Ozgur!)
(Added Mac OS X implementation, explanation of variables,new screenshots for ver/hor modes, warning for use of glasses.)
Line 1: Line 1:
This wiki describes how to use the '''stereo vision''' or '''[http://en.wikipedia.org/wiki/Anaglyph_image anaglyph images]''' ability of [[OpenSceneGraph]] and let you experience the [[FlightGear]] world in 3D. Another excellent example and simple application of FlightGear's flexibility and realism.
This wiki describes how to use the '''stereo vision''' or '''[http://en.wikipedia.org/wiki/Anaglyph_image anaglyph images]''' ability of [[OpenSceneGraph]] and let you experience the [[FlightGear]] world in 3D. Another excellent example and simple application of FlightGear's flexibility and realism.
'''Important Notice:''' Even though it might not pose any danger, try avoiding excessive use of different color paired glasses, and after your flying sessions with the glasses or whatever, let your eyes and brain rest for a while before starting to sew, chop meat, drive 160mph, dig the garden etc.


==Anaglyph, that weird looking glasses...==
==Anaglyph, that weird looking glasses...==
Line 29: Line 32:


After you entered the last value, click "OK" to quit from the Advanced Options window. Remove your pilot raybans, put your fancy 3D glasses and click "Run".
After you entered the last value, click "OK" to quit from the Advanced Options window. Remove your pilot raybans, put your fancy 3D glasses and click "Run".
===Mac OS X===
[[Image:Anaglyphic2.jpg|thumb|Red-Green Anaglyph OSG Render in action]]
Thanks to [http://flightgear.org/forums/memberlist.php?mode=viewprofile&u=1650 someguy] (not some guy, a FlightGear forum member!) for providing Mac OS X instructions. And here is the related [http://www.flightgear.org/forums/viewtopic.php?f=19&t=9222&p=93141#p93141 post]with more screenshots.
# In the Finder, select the menu item Go > Go to Folder... and enter "~/.MacOSX" without the quotes. You will go to a hidden folder in your user directory.
# You should see a file named "environment.plist". Open it in TextEdit.
# Between the <dict> and </dict> tags, add the following:
  <key>OSG_EYE_SEPARATION</key>
  <real>0.025</real>
  <key>OSG_SCREEN_DISTANCE</key>
  <real>0.5</real>
  <key>OSG_STEREO</key>
  <string>ON</string>
  <key>OSG_STEREO_MODE</key>
  <string>ANAGLYPHIC</string>
Don't disturb anything else in there and save the file. Fire up Flightgear and be amazed.
If you don't see environment.plist, you'll need to create it. No problem, just open a new document in TextEdit, enter these lines, and save as environment.plist:
  <?xml version="1.0" encoding="UTF-8"?>
  <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
  <plist version="1.0">
  <dict>
  <key>OSG_EYE_SEPARATION</key>
  <real>0.02500000037252903</real>
  <key>OSG_SCREEN_DISTANCE</key>
  <real>0.5</real>
  <key>OSG_STEREO</key>
  <string>ON</string>
  <key>OSG_STEREO_MODE</key>
  <string>ANAGLYPHIC</string>
  </dict>
  </plist>


===Tweaking The View/Stopping Nausea===
===Tweaking The View/Stopping Nausea===
(on the way...)--[[User:Ozgur|Ozgur]] 17:57, 30 August 2010 (UTC)
A brief explanation of the values we gave for the environment variables goes like this. This info comes directly from the [http://www.openscenegraph.org/projects/osg/wiki/Support/UserGuides/StereoSettings OSG Stereo Settings] page.
 
'''OSG_STEREO=ON:''' is quiet self explanatory...We have to tell OSG to turn on the stereo rendering.
 
'''OSG_STEREO_MODE=ANAGLYPHIC:''' Well, the fanciness level starts here...In our relatively cheap case, we chose anaglyph rendering since we only had red-green or red-cyan glasses to see...So we tell OSG to fit our budget by rendering the scene according to ANAGLYPH method. But on the other hand, OSG provides not only ANAGLYPH (as default), it supplies its user with a wide variety of stereo render options.(Don't get scared by the frame rates shown on the screenshots, enabling stereo view didn't effected the framerates of the old laptop the screenshots were taken).These are;
 
 
*<tt>ANAGLYPH          Use anaglyphic stereo when in stereo (default) (See green-red filtered images).</tt>
*<tt>QUAD_BUFFER Use quad buffered stereo when in stereo.</tt>
*<tt>HORIZONTAL_SPLIT Use horizontal split stereo mode when in stereo [http://wiki.flightgear.org/index.php/File:OSG_Anaglyph_StartScreen.jpg Starting],[http://wiki.flightgear.org/index.php/File:Hor_Cockpit.jpg Running!], [http://wiki.flightgear.org/index.php/File:Stereo_B1900D_View.jpg External Stereo View]</tt>
*<tt>VERTICAL_SPLIT Use vertical split stereo mode when in stereo [http://wiki.flightgear.org/index.php/File:Vertical_Sep_Cockpit.jpg Vertical Separation Cockpit] and [http://wiki.flightgear.org/index.php/File:Vertical_Sep_External.jpg External View]</tt>
 
To understand the red-green images, one can carefully inspect especially the vertically separated images. If you carefully look at [http://wiki.flightgear.org/index.php/File:Hor_Cockpit.jpg this] image, note how the runway markings are appearing in a different perspective in left and right images. What OSG does when you tell to enable the Anaglyph instead of this vertical stereo, it applies color filters that exactly (not at practice sometimes, within color bandwidth limits) matches with your green and red filters on your glasses. Then it overlaps these filtered images and displays as a single image. Then, your left eye, with a green filter, filters the green image and sees the reddish image and vice versa for the right eye. Thus, giving each eye what they should be seeing in a real cockpit is also assembled by our brain, and perceived as a 3D environment.
 
'''OSG_SCREEN_DISTANCE=0.95:''' is the "distance" to your very own screen in metrics. For a good practice, you'd better measure this distance to your screen and not to make it 0.2 meters or 14.3 meters , since the first one is dangerous to your health and latter one to your flight profile. For multiple display, the measurements (should?) be from your viewpoint to the monitor surface. Contributes to the feeling of the depth on your screen.
 
'''OSG_EYE_SEPARATION=0.06:''' Eye seperation...Funny but is the actual distance between two pupils of your eyes. Measure but don't pop them out for a precision measure with a caliper. Makes significant contributions to the realism of the simulator. Generally 5 to 7 cm (0.05 to 0.07 meters). For imperial units convert 1 inch=25.4mm, 1 meter=3.280 ft.
 
==Links==
*[http://www.openscenegraph.org OSG Website]
*[http://www.openscenegraph.org/projects/osg/wiki/Support/UserGuides/StereoSettings Stereo Settings]
*[http://en.wikipedia.org/wiki/Anaglyph_image Anaglyph Image on Wikipedia]
*[http://en.wikipedia.org/wiki/Retinal_rivalry An important warning about using highly filtering glasses]
23

edits

Navigation menu