The Visualization ToolKit (VTK) is an open source, freely available software system for 3D computer graphics, image processing, and visualization. To learn more about VTK there is a textbook published by Prentice-Hall (The Visualization Toolkit, An Object-Oriented Approach To 3D Graphics, 2nd edition" ISBN 0-13-954694-4) and on-line information on VTK can be obtained from Kitware.
VTK consists of a C++ class library and several interpreted interface layers including Tcl/Tk, Java, and Python. VTK has been implemented on nearly every Unix-based platform and PC's (Windows NT and Windows95). The design and implementation of the library has been strongly influenced by object-oriented principles.
The graphics model in VTK is at a higher level of abstraction than rendering libraries like OpenGL or PEX. This means it is much easier to create useful graphics and visualization applications. In VTK applications can be written directly in C++, Tcl, Java, or Python. In fact, using the interpreted languages Tcl or Python with Tk, and even Java with its GUI class libraries, it is possible to build useful applications really, really fast.
VTK supports a wide variety of visualization algorithms including scalar, vector, tensor, texture, and volumetric methods; and advanced modeling techniques like implicit modeling, polygon reduction, mesh smoothing, cutting, contouring, and Delaunay triangulation. Moreover, VTK has directly integrated dozens of imaging algorithms into the system so you can mix 2D imaging / 3D graphics algorithms and data.
To use VTK either on your workstation or from another machine such as escher.nersc.gov, you must have OpenGL and X windows installed with the GLX X extension on your local workstation. OpenGL is easily available for Unix workstation and most other platforms. One way to see if your Unix workstation has OpenGL installed is to:
% xdpyinfo | grep GLXIf OpenGL is installed, you will get one line of output that says "GLX". If you do not get that line, you will have to install OpenGL on your machine. To set-up the VTK environment on escher.nersc.gov do a module load vtk.
The VTK distribution comes with a variety of examples. There are a few things to note about these examples. The first, is that you must be in the example directory to execute them. Secondly, not all examples work. As we find problems we report them to the VTK user group.
To run the VTK and Tcl examples, do:
module load vtk setenv DISPLAY yourworkstation:0 cd /usr/local/pkg/graphics/vtk/graphics/examplesTcl vtk example_filename
VTK allows the programmer to map keystrokes into particular events. Many, if not all, of the example programs use a VTK supplied object that supports the following events and mappings. The mapping comes directly from a VTK .h file. Please note that we have found most examples reverse the meaning of the j (joystick) and t (trackball) keys. In other words, pressing t in the VTK window will use the joystick or mouse type interaction; typing a j will move to the trackball (default).
Mouse bindings:
camera: Button 1 - rotate
Button 2 - pan
Button 3 - zoom
ctrl-Button 1 - spin
actor: Button 1 - rotate
Button 2 - pan
Button 3 - uniform scale
ctrl-Button 1 - spin
ctrl-Button 2 - dolly.
Keyboard bindings (upper or lower case):
j - joystick like mouse interactions
t - trackball like mouse interactions
o - object/ actor interaction
c - camera interaction
r - reset camera view
w - turn all actors wireframe
s - turn all actors surface
u - execute user defined function
p - pick actor under mouse pointer (if pickable)
3 - toggle in/out of 3D mode (if supported by renderer)
e - exit
q - exit
There are a few really good web sites on VTK. The Kitware site contains the software, examples, man pages, etc. Another very good site has examples, lots of links, etc. and is located at http://vtk.barre.nom.fr/ The searchable e-mail archive web site (maintained by NCSA) is at: http://http://vr.ncsa.uiuc.edu/vtkusers