Immersive Visualization / IQ-Station Wiki

This site hosts information on virtual reality systems that are geared toward scientific visualization, and as such often toward VR on Linux-based systems. Thus, pages here cover various software (and sometimes hardware) technologies that enable virtual reality operation on Linux.

The original IQ-station effort was to create low-cost (for the time) VR systems making use of 3DTV displays to produce CAVE/Fishtank-style VR displays. That effort pre-dated the rise of the consumer HMD VR systems, however, the realm of midrange-cost large-fishtank systems is still important, and has transitioned from 3DTV-based systems to short-throw projectors.

Difference between revisions of "ImmersiveVTK"

From IQ-Station Wiki
Jump to navigation Jump to search
m (6 revisions: restoring the wiki)
 
(3 intermediate revisions by one other user not shown)
Line 1: Line 1:
'''** NOTE: This page is currently unreferenced by the IQ-station wiki, as it is yet preliminary, and thus intended as a means of communication between those working on the effort.  However, the page should, as much as possible, be designed with an eye toward being a fully public page. **'''
'''** NOTE: This page is currently unreferenced by the IQ-station wiki, as it is yet preliminary, and thus intended as a means of communication between those working on the effort.  However, the page should, as much as possible, be designed with an eye toward being a fully public page. **'''


[[Image:CEP 3001.jpg|right|thumb|Projectors from the [[Margaret Dolinsky#Sponsae Christi 2008|Sponsae Christi]] event.]]
[[Image:img_7185s.jpg|right|thumb| [http://iq-station.com/img/img_7185s.jpg] [http://iq-station.com/img/img_7186s.jpg] [http://iq-station.com/img/img_7187s.jpg] VTK working on the CAVE front wall. (NOTE: my hosting site doesn't allow Media-Wiki image uploads -- so follow the external link.)]]


=Immersive VTK=
=Immersive VTK=
Line 16: Line 16:
As part of this effort, VTK is also gaining capabilities.
As part of this effort, VTK is also gaining capabilities.


Through now, the focus has been (and still is) on enabling off-axis rendering through the standard <CODE>vtkCamera</CODE> class.  Future enhancements will include  
Through now, the focus has been (and still is) on enabling off-axis rendering through the standard <CODE>vtkCamera</CODE> class.  Future enhancements will include <FONT SIZE=26>...</FONT>
 


This page describes how to compile, configure, and run VTK with these extensions.
This page describes how to compile, configure, and run VTK with these extensions.
==Current Status -- Executive Summary==
* Seems to work okay on front wall of CAVE
* Does not work on other walls (issues with Deering calculations)
* Can open multiple Render-Windows on multiple X screens
* Interface to specify which X11 screen to open on is a hack


==How to Run Immersive VTK==
==How to Run Immersive VTK==


* Presently, Bill uses a TCL script he wrote that can read the Vrui 1.0 VRDeviceDaemon protocol and then set the eye/head position from the incoming stream.
Presently, Bill uses a TCL script he wrote that can read the Vrui 1.0 VRDeviceDaemon protocol and then set the eye/head position from the incoming stream.
* <FONT SIZE=26>...</FONT>
* <CODE>% vtk</CODE>
* <CODE>vtk% source sphere5.tcl</CODE> -- a modified version of one of my tutorial applications
* <CODE>vtk% source vruidd.tcl</CODE> -- a link from the Vrui deviceDaemon to VTK
* check the "Do Tracking" box


==How to Download Immersive VTK==
==How to Download Immersive VTK==
Line 52: Line 62:
There are several new methods/values associated with the <CODE>vtkCamera</CODE> class designed to enable quick and easy usage of off-axis rendering.
There are several new methods/values associated with the <CODE>vtkCamera</CODE> class designed to enable quick and easy usage of off-axis rendering.


* vtkCamera::SetScreenBottomLeft  <x> <y> <z>
* <CODE>vtkCamera::SetScreenBottomLeft  <x> <y> <z></CODE>
* vtkCamera::SetScreenBottomRight <x> <y> <z>
* <CODE>vtkCamera::SetScreenBottomRight <x> <y> <z></CODE>
* vtkCamera::SetScreenTopRight    <x> <y> <z>
* <CODE>vtkCamera::SetScreenTopRight    <x> <y> <z></CODE>
* vtkCamera::SetEyePosition <x> <y> <z> -- really just sets the location of the center of the two eyes
* <CODE>vtkCamera::SetEyePosition <x> <y> <z></CODE> -- really just sets the location of the center of the two eyes
* vtkCamera::SetUseDeeringFrustrum <flag> -- NOTE: new version will remove the extra 'r'
* <CODE>vtkCamera::SetUseDeeringFrustrum <flag></CODE> -- NOTE: new version will remove the extra 'r'
* <CODE>vtkCamera::GetModelTransformMatrix</CODE> -- get the model matrix and then alter it to move the scene relative to the CAVE origin


Here are some methods added by Bill:
Here are some methods added by Bill:
* vtkRenderWindow::SetXDisplay <screen> -- actually this sets the screen portion of the display (BS: I couldn't figure out how to do strings, so just did the screen number since that's all I need for testing in the CAVE -- and I'll let Kitware do things the proper way).
* <CODE>vtkRenderWindow::SetXDisplay <screen></CODE> -- actually this sets the screen portion of the display (BS: I couldn't figure out how to do strings, so just did the screen number since that's all I need for testing in the CAVE -- and I'll let Kitware do things the proper way).
* <CODE>vtkCamera::SetTF1 <flag></CODE> -- a generic flag for me to adjust some internal tests
* <CODE>vtkCamera::SetTF2 <flag></CODE> -- a generic flag for me to adjust some internal tests


And for stereo, there are the already-existing methods:
And for stereo, there are the already-existing methods:
* vtkRenderWindow::SetStereoCapableWindow <flag> -- for active stereo (must be done before the window is opened)
* <CODE>vtkRenderWindow::SetStereoCapableWindow <flag></CODE> -- for active stereo (must be done before the window is opened)
* vtkRenderWindow::SetStereoTypeToCrystalEyes -- for active stereo
* <CODE>vtkRenderWindow::SetStereoTypeToCrystalEyes</CODE> -- for active stereo
* vtkRenderWindow::SetStereoRender <flag> -- set to <CODE>1</CODE> to turn stereo on
* <CODE>vtkRenderWindow::SetStereoRender <flag></CODE> -- set to <CODE>1</CODE> to turn stereo on


==Immersive VTK Internals==
==Immersive VTK Internals==
Line 74: Line 87:
===Outstanding Issues===
===Outstanding Issues===
* The Deering off-axis rendering code still doesn't work. <CODE>:-(</CODE>
* The Deering off-axis rendering code still doesn't work. <CODE>:-(</CODE>
** I (BS) have a hack version that works okay for the front screen, but doesn't work for other screens yet
** The <CODE>ComputeScreenOrientation</CODE> method doesn't use the proper indices (and I don't know whether to do row-major or column-major)
** The <CODE>ComputeScreenOrientation</CODE> should also include the screen's location -- but I don't know how to properly do that yet
* <CODE>vtkXOpenGLRenderWindow</CODE> class
* <CODE>vtkXOpenGLRenderWindow</CODE> class
** should have the means to specify which display to render to
** should have the means to specify which display to render to
** should probably call the <CODE>CreateAWindow()</CODE> method instead of <CODE>XOpenDisplay()</CODE> all over the place.
** should probably call the <CODE>CreateAWindow()</CODE> method instead of <CODE>XOpenDisplay()</CODE> all over the place.
* Thus the <CODE>vtkRenderWindow</CODE> class should have a value and method to set the display context that is passed down to the hardware handlers (such as <CODE>vtkXOpenGLRenderWindow</CODE>).
* Thus the <CODE>vtkRenderWindow</CODE> class should have a value and method to set the display context that is passed down to the hardware handlers (such as <CODE>vtkXOpenGLRenderWindow</CODE>).
* I get this odd bug where the render window freezes when I first start the tracking loop
* I get this odd bug where the render window freezes when I first start the tracking loop (tested on Ubuntu 9.04):
** I can unfreeze the window by turning off stereo, then turning it back on, after which I have to reset stereo type to CrystalEyes:
renWin SetStereoRender 0
renWin Render
renWin SetStereoRender 1
renWin SetStereoTypeToCrystalEyes
renWin Render
 
===Other Adjustments===
 
Bill fixed some other issues when entrenched in the code:
* <CODE>vtkCamera::PrintSelf</CODE> method was improved

Latest revision as of 22:29, 29 August 2011

** NOTE: This page is currently unreferenced by the IQ-station wiki, as it is yet preliminary, and thus intended as a means of communication between those working on the effort. However, the page should, as much as possible, be designed with an eye toward being a fully public page. **

File:Img 7185s.jpg
[1] [2] [3] VTK working on the CAVE front wall. (NOTE: my hosting site doesn't allow Media-Wiki image uploads -- so follow the external link.)

Immersive VTK

VTK is a general-purpose visualization library that is widely used by the Scientific Visualization Community. VTK is supported by the commercial company Kitware, Inc.

There are also many general-purpose user-oriented tools built on VTK, including Kitware's ParaView, as well as VisIt.

Recently, Kitware has been supported by Idaho National Lab to add immersive functionality to ParaView. As part of this effort, VTK is also gaining capabilities.

Through now, the focus has been (and still is) on enabling off-axis rendering through the standard vtkCamera class. Future enhancements will include ...


This page describes how to compile, configure, and run VTK with these extensions.

Current Status -- Executive Summary

  • Seems to work okay on front wall of CAVE
  • Does not work on other walls (issues with Deering calculations)
  • Can open multiple Render-Windows on multiple X screens
  • Interface to specify which X11 screen to open on is a hack

How to Run Immersive VTK

Presently, Bill uses a TCL script he wrote that can read the Vrui 1.0 VRDeviceDaemon protocol and then set the eye/head position from the incoming stream.

  • % vtk
  • vtk% source sphere5.tcl -- a modified version of one of my tutorial applications
  • vtk% source vruidd.tcl -- a link from the Vrui deviceDaemon to VTK
  • check the "Do Tracking" box

How to Download Immersive VTK

Immersive VTK is currently only available as a special git development branch known as "vtk-stereo".

... (Aashish can explain this part)


How to Compile Immersive VTK

Basically compilation is no different than any trunk/branch of VTK.

But there are some cmake flags that I set to speed things up since I compile frequently:

  • % cd build
  • % ccmake ../vtk-stereo
    • set BUILD_EXAMPLES to OFF
    • set BUILD_SHARED_LIBS to OFF
    • set BUILD_TESTING to OFF
    • set VTK_WRAP_TCL to ON (since I use a Tcl script for testing)
    • 'c' to configure (may have to repeat once)
    • 'g' to generate
  • % make -j 8 (or however many threads are desired)


The Immersive VTK API

There are several new methods/values associated with the vtkCamera class designed to enable quick and easy usage of off-axis rendering.

  • vtkCamera::SetScreenBottomLeft <x> <y> <z>
  • vtkCamera::SetScreenBottomRight <x> <y> <z>
  • vtkCamera::SetScreenTopRight <x> <y> <z>
  • vtkCamera::SetEyePosition <x> <y> <z> -- really just sets the location of the center of the two eyes
  • vtkCamera::SetUseDeeringFrustrum <flag> -- NOTE: new version will remove the extra 'r'
  • vtkCamera::GetModelTransformMatrix -- get the model matrix and then alter it to move the scene relative to the CAVE origin

Here are some methods added by Bill:

  • vtkRenderWindow::SetXDisplay <screen> -- actually this sets the screen portion of the display (BS: I couldn't figure out how to do strings, so just did the screen number since that's all I need for testing in the CAVE -- and I'll let Kitware do things the proper way).
  • vtkCamera::SetTF1 <flag> -- a generic flag for me to adjust some internal tests
  • vtkCamera::SetTF2 <flag> -- a generic flag for me to adjust some internal tests

And for stereo, there are the already-existing methods:

  • vtkRenderWindow::SetStereoCapableWindow <flag> -- for active stereo (must be done before the window is opened)
  • vtkRenderWindow::SetStereoTypeToCrystalEyes -- for active stereo
  • vtkRenderWindow::SetStereoRender <flag> -- set to 1 to turn stereo on

Immersive VTK Internals

...


Outstanding Issues

  • The Deering off-axis rendering code still doesn't work. :-(
    • I (BS) have a hack version that works okay for the front screen, but doesn't work for other screens yet
    • The ComputeScreenOrientation method doesn't use the proper indices (and I don't know whether to do row-major or column-major)
    • The ComputeScreenOrientation should also include the screen's location -- but I don't know how to properly do that yet
  • vtkXOpenGLRenderWindow class
    • should have the means to specify which display to render to
    • should probably call the CreateAWindow() method instead of XOpenDisplay() all over the place.
  • Thus the vtkRenderWindow class should have a value and method to set the display context that is passed down to the hardware handlers (such as vtkXOpenGLRenderWindow).
  • I get this odd bug where the render window freezes when I first start the tracking loop (tested on Ubuntu 9.04):
    • I can unfreeze the window by turning off stereo, then turning it back on, after which I have to reset stereo type to CrystalEyes:
renWin SetStereoRender 0
renWin Render
renWin SetStereoRender 1
renWin SetStereoTypeToCrystalEyes
renWin Render

Other Adjustments

Bill fixed some other issues when entrenched in the code:

  • vtkCamera::PrintSelf method was improved