Visualization of Vector Field by Virtual Reality

3 downloads 0 Views 156KB Size Report
Yuichi Tamura and Tetsuya Sato. Theory and Computer Simulation Center. National Institute for Fusion Science, Toki 509-5292, Japan. (Received October 31 ...
Progress of Theoretical Physics Supplement No. 138, 2000

665

Visualization of Vector Field by Virtual Reality Akira Kageyama,∗) Yuichi Tamura and Tetsuya Sato Theory and Computer Simulation Center National Institute for Fusion Science, Toki 509-5292, Japan (Received October 31, 1999) A visualization software program is developed in order to analyze three dimensional vector fields by means of today’s advanced virtual reality technology. This program enables simulation researchers to interactively visualize stream lines, tracer particle motions, isosurfaces, etc. with stereo view. The program accepts any kind of vector fields on structured mesh as an input data. A virtual reality hardware system, on which the program operates, and details of the program are described.

§1. Introduction

Data visualization of 3-dimensional (3D) vector fields has always been a challenge for simulation researchers. It is, in general, very difficult to grasp the spatial structure of 3D vector fields. The visualization of scalar fields is relatively easy if one invokes a graphic workstation (GWS) and a visualization software like AVS or AVS/Express.∗∗) However, as for a vector field, or vector fields, even a high-end GWS are incapable to analyze the field structure unless it is exceptionally simple. We apparently need a new technology for scientific visualization of 3D vector field analysis. Fortunately, there have been great advances in virtual reality (VR) technology in these several years. By a VR system, people see virtual 3D objects and their motion in stereo and they can interactively communicate with them. Those who experienced recent VR systems would be surprised for its high quality and reality. It is a natural idea to apply the VR technology to the scientific visualization. Recently, we have installed a virtual reality system named CompleXcope. CompleXcope is one of the so-called CAVE system, which is a projector based, room-sized VR system developed at Electronic Visualization Laboratory (EVL), University of Illinois, Chicago. 1) We have used CompleXcope as a powerful scientific visualization tool of many kinds of simulation researches including fusion plasma, magnetohydrodynamic dynamo, and polymer chain dynamics. 2), 3) It is confirmed from our experience so far that the VR is certainly very useful for scientific visualization of complex 3D data. To date, VR programs on CompleXcope have been developed one by one, depending on the simulation type and visualization purpose. Each simulation researcher had to develop his/her own VR programs to analyze his/her own simulation data. An apparent problem of this approach is that it takes too much time to develop each VR program since most simulation researchers are not familiar with ∗) ∗∗)

E-mail address: [email protected] Product of Advanced Visual Systems Inc.

666

A. Kageyama, Y. Tamura and T. Sato

computer graphics programming. In order to resolve this difficulty, we have developed a general purpose VR program for the scientific visualization on CompleXcope. The program is designed especially to visualize 3D vector fields. In this paper, we report the development of this program after a review the CompleXcope hardware system. §2. CompleXcope system

Fig. 1. VR system CompleXcope. The system has 4 screens; 3 wall screens and 1 floor screen. Stereo color images are projected onto them.

Fig. 2. Screens of CompleXcope. Floor image is projected from a ceiling-mounted projector. Wall images (Right, Front, and Left) are rear-projected.

CompleXcope has 3 soft screens for the walls and 1 hard screen for the floor (Fig. 1). The size of each screen is 10 foot × 10 foot (Fig. 2). This configuration is the same as that of the original CAVE system developed by EVL. We stereo stereo glasses glasses have found so far that the present four screen system of the CompleXcope is sufficiently useful for our scientific visualization purpose. The simulation data wand wand (raw data) is transferred to a GWS (SGI ONYX2; 8× MIPS R12000, 4× Infinite Reality 2) of CompleXcope via FTP. Fig. 3. Snapshot of realtime data analysis by Then, stereo color images are generated CompleXcope. Viewer in the CompleXby the GWS and projected to 4 screens cope room wears a stereo glasses and has a by 4 projectors (Electrohome MAR3D mouse called wand. Position and direction of the glasses and the wand is tracked QUEE 9500LC-3D). The wall screen imin real time by the system. ages are rear-projected and the floor screen image is down-projected from the ceiling. The four large stereo screens, including the floor, ensures broad range of

Visualization of Vector Field by Virtual Reality

Fig. 4. Liquid crystal shutter stereo glasses. The circle indicates the magnetic sensor for the tracker.

667

Fig. 5. Wand; a 3D mouse.

view angle of a viewer inside the CompleXcope room (Fig. 3). Since the viewer is surrounded by stereo images, they feel like that they are really “immersed” in a 3D virtual space. They soon forget the existence of the walls since the image boundaries between the screens are smoothly connected. The viewer in the CompleXcope wears a liquid crystal shutter stereo glasses to see the stereo images (Fig. 4). And the viewer has a portable controller called “wand” (Fig. 5). The wand has 3 buttons and a joystick to communicate with the virtual objects. The position and the direction of both the stereo glasses and the wand is detected in real time by a magnetic tracking system (Ascension Technology, Flock of Birds). Using the tracking data of the viewer’s eyes (or stereo glasses), the viewpoint of the four computer graphics (CG) images (3 walls and 1 floor) are re-calculated many times in every second (Fig. 6). Therefore, the viewer can walk in the CompleXcope room and observe 3D objects from any position and direction. If one wants to look the back side of a virtual object in front of him/her, just walk through the objects and then look back. The viewpoint adjustment is done so quickly that every virtual object looks very natural. We use the CAVE library∗) developed at EVL for the automatic synchronization of images and image generation. The CAVE library also provides various functions to get data from the tracking device and the wand. CAVE library supports SGI GL, OpenGL, Open Inventor, and SGI Performer for the virtual world modeling. OpenGL is the de facto standard of the basic 3D CG library today. 4), 5) We usually use OpenGL since 3D objects to be modeled Fig. 6. Realtime adjustment of the view point by the tracker and the CAVE library. in our scientific visualization programs, ∗)

http://www.evl.uic.edu/EVL/index.html

668

A. Kageyama, Y. Tamura and T. Sato

such as temperature isosurface or magnetic field lines, are clearly defined numerically or analytically. Although a CompleXcope programming manual with OpenGL and the CAVE library is written by the authors, 6) we have found that simulation researchers feel difficulty in making their own VR programs. This is the motivation of the general purpose visualization program for the CompleXcope VR environment. §3. VFIVE program

3.1. Program design We have developed a VR program named VFIVE (Vector Field Interactive Visualization Environment) for 3D interactive visualization of vector fields by CompleXcope. The purpose of the VFIVE development is to make simulation researchers free from VR (OpenGL+CAVE library) programming. VFIVE is a command driven program. The user just type vfive command with a data file name as an option. Then, the field data is automatically “cooked” and one can immediately analyze the 3D data in the CompleXcope VR space. VFIVE, in its latest version, interactively shows the following visualization objects in CompleXcope; (1) stream lines with tracer particles, (2) force lines, (3) vector arrows, and (4) isosurfaces. The objects (1) to (3) are mainly for vector field analysis, and (4) is mainly for scalar field. 3.2. Stream line and force line The steam line x(t) of a vector field u = (ux , uy , uz ) is defined as dx/dt = u. A virtual ball (tracer particle) appears at the position x at each time t. As the integration of the above equation goes on, the viewer in the CompleXcope room observe that the tracer particle “flys” in the CompleXcope room. A stream line is shown by a “contrail” of the tracer particle (Fig. 7). The force line is defined in the same way. The only difference is that it is traced both in the positive and the negative directions of the u vector and the parameter t does not correspond to time in this case. The starting point of each stream/force line is specified interactively and intuitively by the wand. The actual data analysis in the CompleXcope is done in the following way: After one types the vfive command, he/she gets into the CompleXcope room. Wearing the stereo glasses, one will find that the boundary region curve of the simulation data is “floating” in the CompleXcope room. This boundary is automatically calculated and generated by VFIVE. (For example, one will find a cylinder if the simulation is done in a cylindrical geometry.) One can walk in the CompleXcope room to approach to any special region in the data space where he/she is interested in. Then, one makes a reach to place the wand at a position where he/she wants to start a stream line. Then, a click of a wand button starts a stream line from the wand position (or a force line; they can be switched by a virtual visor menu described later). As the integration of the stream line goes on, one sees a virtual tracer particle flys in the CompleXcope room with a contrail stream line. A lot of stream lines can be traced

Visualization of Vector Field by Virtual Reality

669

Fig. 7. Example of 3D stream lines with tracer particles. In the actual CompleXcope system, the viewer sees that the particles are “flying” in the CompleXcope room. Everything look in stereo. One can walk around the objects, or walk through them.

at the same time. In fact, only one stream line is not so much useful to understand a complex 3D structure of a vector field. Instead, many clicks of the wand button in quick succession with slowly moving hand position generates many tracer particles with slightly different initial starting points around there. Observing the motion of the bunch of the particles as well as the bundle of orbit curves helps the researcher to grasp 3D vector field structure around there. This kind of stream line visualization of a vector field would be too messy in the “traditional” GWS-based visualization. However, in the CompleXcope, one can easily understand the structure of possibly tangled and complex orbits since one sees the orbits and the particle motions in stereo and he/she can walk around or even walk through them while the particles are flying. The stream lines, isosurfaces, etc., can be shown at the same time (3D superimposition). For example, in the case of a simulation data of the magnetohydrodynamics, one can see many force lines of the magnetic field (i.e., magnetic field lines) and many stream lines of the flow as well as scalar isosurfaces of temperature, magnetic energy density, etc. at the same time. 3.3. Vector 3D arrow One of the visualization methods of a vector fields is to place many vector arrows in the field. Each arrow indicates the vector direction at that position and its length denotes the vector amplitude. In VFIVE, when one presses a wand button, he/she

670

A. Kageyama, Y. Tamura and T. Sato

will see many vector arrows appearing around the wand (and, therefore, around the hand). The region where the arrows are shown is a sphere of radius a couple of feets and its center is the wand tip (Fig. 8). The vector arrows are “on” while one keeps pressing the wand button. As one moves the wand in the CompleXcope room (by stretching or shifting the hand), all the arrows smoothly follow the wand motion. Since the vector values at all arrow positions are interpolated in real time from the input data many times in a second, the arrows smoothly change the directions and lengths as they follows the wand. By observing the 3D arrows, the viewer can grasp the structure of the vector field. Of course, superposition of stream lines, force lines, and vector arrows at a data region of very complex structure enhance the 3D image of the viewer of the vector field.

Fig. 8. Example of vector arrows. When one presses a wand button, he/she sees that vector arrows appear around the wand. They denote the vector field at each position. The arrows follow the wand motion.

3.4. Isosurface Scalar fields are well visualized by isosurfaces. Since an isosurface or superimposed several isosurfaces appear in stereo in the CompleXcope, one can easily grasp the spatial distribution of the scalar field. The isosurface in VFIVE is generated by the Marching Cubes algorithm. 7) It is designed to accept non-uniform/curved coordinate systems.

Visualization of Vector Field by Virtual Reality

671

3.5. Input data file format The input data file format of vfive command is designed to be compatible with AVS (AVS/Express) since AVS is one of the most popular scientific visualization software on GWS. Therefore, researchers are able to analyze the same 3D data both on a GWS (by AVS) and on the CompleXcope (by VFIVE). An example of the input data file format of VFIVE (or an AVS-field-data format) is as follows. (Words after # are comments.) # AVS field data (Sample of VFIVE input data) # # Xcope nvect 2 # ndim = 3 # 3D simulation data dim1 = 50 # grid size in 1st direction dim2 = 100 # grid size in 2nd direction dim3 = 120 # grid size in 3rd direction nspace = 3 # shown in 3D space veclen = 9 # 9 fields (2 vectors + 3 scalars) data = double # double precision field = irregular # general non-rectangular coordinates # # Coordinates # coord 1 file=x-coord.dat filetype=unformatted coord 2 file=y-coord.dat filetype=unformatted coord 3 file=z-coord.dat filetype=unformatted # # Fields # variable 1 file=bx.dat filetype=unformatted variable 2 file=by.dat filetype=unformatted variable 3 file=bz.dat filetype=unformatted variable 4 file=vx.dat filetype=unformatted variable 5 file=vy.dat filetype=unformatted variable 6 file=vz.dat filetype=unformatted variable 7 file=pressure.dat filetype=unformatted variable 8 file=density.dat filetype=unformatted variable 9 file=temperat.dat filetype=unformatted

3.6. Coordinate system In order to make VFIVE being useful for many types of simulation data, we have designed it to accept simulation data on general coordinates of structured mesh. (The present version of VFIVE does not accept unstructured mesh.) Therefore, VFIVE accepts all kinds of rectangular coordinates such as cartesian, cylindrical, spherical coordinates, etc. and even non-rectangular coordinates, too. (In the term of the AVS-field-data format, VFIVE accepts both the rectilinear and irregular coordinates types.)

672

A. Kageyama, Y. Tamura and T. Sato

3.7. Virtual visor menu Since the input data of VFIVE can be a set of several vectors (and scalars), the viewer has to select, or switch, one of them many times during the data analysis in the CompleXcope. We have developed a virtual visor menu of VFIVE for this purpose by which one can easily select/switch the fields (Fig. 9). When one presses a wand button, a virtual menu panel appears in front of his/her eyes several meters away. A menu panel can be selected by shooting it by a virtual laser beam emitted from the wand. The menu panel always appears in front of the eyes even one rotates the head; It follows the head rotation. We have found that this virtual visor menu∗) is very useful especially when we analyze several data regions at the same time. In those cases, we have to look around many times, observing force lines, tracer particles, etc. and the virtual visor menu enables flexible and quick menu choice.

Fig. 9. Virtual visor menu. When one presses a wand button, a virtual visor menu appears in front of the eyes. Shooting a panel of the menu by a virtual laser beam emitted from the wand, the menu is selected.

§4.

Summary

With the development of the recent VR technology, scientific visualization has got into a new era. The VR enables scientists to analyze highly complex 3D data ∗) We got the idea of the visor menu from the CAVE visor program developed by Dr. Jason Leigh et al. of EVL. The original EVL visor is much more sophisticated than ours. But our simplified visor is sufficient for our scientific visualization.

Visualization of Vector Field by Virtual Reality

673

in a very natural way in the VR space. They can observe 3D data in stereo. They can “immerse” their body into the data. And they can communicate with data interactively and in real time. We have installed a room-sized VR system named CompleXcope. And we have developed a general purpose CompleXcope program VFIVE for the scientific visualization of 3D simulation data. By VFIVE, one can interactively visualize stream lines, force lines, tracer particle motions, vector arrows and isosurfaces in the CompleXcope VR space. VFIVE is especially useful for 3D visualization of simulation data of fluid dynamics, magnetohydrodynamics, and others, with highly complicated spatial vector structure. Since VFIVE is programmed by OpenGL and CAVE library, it is portable to many other CAVE VR systems. Acknowledgements The authors would like to thank Dr. Jason Leigh, University of Illinois, Chicago, for valuable technical advice on CAVE system. We would also like to thank Nissho Electronics Corp. for hardware setup of our CompleXcope system. References 1) C. Cruz-Neira, D. J. Sandin and T. A. DeFanti, Proceedings of SIGGRAPH ’93 (1993), p. 135. 2) A. Kageyama and T. Sato, Proceedings of 4th Computer Visualization Symposium (in Japanese) (1998), p. 61. 3) A. Kageyama, Y. Tamura and T. Sato, Transactions of the Virtual Reality Society of Japan 4 (1999), No. 4. 4) J. Neider, T. Davis and M. Woo, OpenGL T M Programming Guide, Second Edition (AdisonWesley, 1997). 5) M. J . Kilgard, OpenGL Programming for the X Window System (Addison-Wesley, 1996). 6) A. Kageyama and T. Sato, VR System CompleXcope Programming Guide (in Japanese) (NIFS Research REPORT NIFS-MEMO No. 28, 1998). 7) W. E. Lorensen and H. E. Cline, Computer Graphics (Proceedings of SIGGRAPH ’87 ) 21 (1987), p. 163.