AIIM +/67531/metadc1312465/... · ,-°+ +,_ AIIM ,,_ _ + UCRL-JC-116231 PREPRINT Visualizing 3D...

13
,-°+ + ,_ AIIM ,,_ _+

Transcript of AIIM +/67531/metadc1312465/... · ,-°+ +,_ AIIM ,,_ _ + UCRL-JC-116231 PREPRINT Visualizing 3D...

Page 1: AIIM +/67531/metadc1312465/... · ,-°+ +,_ AIIM ,,_ _ + UCRL-JC-116231 PREPRINT Visualizing 3D Velocity Fields Near Contour Surfaces , N. Max, R. Crawfis._, C. Grant This paper was

,-°+ +,_ AIIM ,,_ _ +

Page 2: AIIM +/67531/metadc1312465/... · ,-°+ +,_ AIIM ,,_ _ + UCRL-JC-116231 PREPRINT Visualizing 3D Velocity Fields Near Contour Surfaces , N. Max, R. Crawfis._, C. Grant This paper was
Page 3: AIIM +/67531/metadc1312465/... · ,-°+ +,_ AIIM ,,_ _ + UCRL-JC-116231 PREPRINT Visualizing 3D Velocity Fields Near Contour Surfaces , N. Max, R. Crawfis._, C. Grant This paper was

UCRL-JC-116231PREPRINT

Visualizing 3D Velocity Fields Near Contour Surfaces ,

N. Max, R. Crawfis

._, C. Grant

This paper was prepared for submittal toVisualization '94

Washington, DCOctober 17-21 1994

March 1994

This is a preprint of apaper intended forpublication in a journal orproceedings. Sincechanges may be made before publication, this preprint is made available with theunderstanding that it will not be cited or reproduced without the permission of theauthor.

1I

M,.STER ,A_

OmTR_UTIONOFTHiSDOOUMENTISUNL_ITm_

Page 4: AIIM +/67531/metadc1312465/... · ,-°+ +,_ AIIM ,,_ _ + UCRL-JC-116231 PREPRINT Visualizing 3D Velocity Fields Near Contour Surfaces , N. Max, R. Crawfis._, C. Grant This paper was

DISCLAIMER

This document was prepared as an account of work sponsored by an agency of theUnited States Government. Neither the United States Government nor the Universityof California nor any of their employees, makes any warranty, express or implied, orass umes any legal liability or responsibility for the accuracy, completeness, or usefulness

of any information, apparatus, product, or process disclosed, or represents that its use _..would not infringe privately owned rights. Reference herein to any specific commercialproducts, process, or service by trade name, trademark, manufacturer, or otherwise,

does not necessarily constitute or imply its endorsement, recommendation, or favoring 1by the United States Government or the University of California. The views and Iopinions of authors expressed herein do not necessarily state or reflect those of theUnited States Government or the University of California, and shall not be used foradvertising or product endorsement purposes.

4_

Page 5: AIIM +/67531/metadc1312465/... · ,-°+ +,_ AIIM ,,_ _ + UCRL-JC-116231 PREPRINT Visualizing 3D Velocity Fields Near Contour Surfaces , N. Max, R. Crawfis._, C. Grant This paper was

¢

Visualizing 3D Velocity Fields NearContour Surfaces

Nelson Max

RogerCrawfisCharles Grant

Lawrence LivermoreNationalLaboratoryLivermore,California94551

ponent. It can also be an independent scalar field definedAbstract on the same volume, for example, porosity ina flowsimu-

lation, or a linear or quadratic function for interactive slic-Vector field rendering is difficult in 3D because the ing. We report here on four different techniques for

vector icons overlap and hide each other. Weproposefour visualizing velocity fields near contour surfaces.&fferent techniques for visualizing vectorjields only nearsurfaces. Thefirst uses motion blurredparticles in a thick- Spot Noise)

ened region around the surface. The second uses a voxelgrid to contain integral curves of the vectorfield. The third VanWijk [vanWijk91] generated a directional textureuses many antialiased lines through the surface, and the by superimposing many oriented shapes such as ellipses.fourth uses hairs sprouting from the surface and then For texture on curved surfaces, the texture plane isbending in the direction of the vectorfield. All the methods mapped to the surface,and the texture generation accountsuse the graphics pipeline, allowing real time rotation and for the stretching induced by the mapping. VanWijk visu-interaction, and the hrst two methods can animate the tex- alized a velocity field on a ship hull with this method. Ca-ture to move in theflow determined by the velocityfield, bral [Cabra193] has generated similar but more accurate

2D velocity textures by "Line Integral Convolution" ofrandom noise, and Forssell [Forssel193]entended this with

Introduction mapping to visualize velocity near an airplane surface.Both of these techniques can be animated tomake the tex.

There are many representations of velocity fields: ture flow.However, they are not applicable tocontour sur-streamlines, stream surfaces, particle traces, simulated faces, which cannot easily be parameterized.smoke ..... etc. One of the simplest is to scatter vectoricons, for example, small line segments, throughout the Stolk and van Wijk [Stolk92, vanWijk93] have alsovolume. There are two fundamental problems withsuch an visualized flows with surface particles: individual spotsapproach.First, the 2D projection of a line segment is am- motion-blurred to elliptical shapes and composited sepa-biguous; many 3D segments can have the sameprojection, ratelyonto the image in software. Each spot has a surfaceSecond, densely scattered icons can overlap and obscure normal, which is carried along appropriately by the flow,each other, leading to a confusing image. These problems and used in the shading. These particles can also move incan be partially solved_with real time (or playback) anima- animation, but only on surfaces related to the flow,not ontion, since motio'aparallax can resolve the projection am- fixed contour surfaces of an unrelated function. Here webiguities. In addition, icon motion in the velocity direction use the same sort of spots, but take advantage of hardwarecan give added visual information, rendenng for interactive speed. We do not restrict the par-

ticles to lie on a surface, and therefore do not use normalsThe second problem can also be resolved by restrict- in the shading. Instead, we think of the particles as

ing the icons to special regions of interest. For example, in spheres, which are motion blurred to ellipsoids. We only[Crawfis92]and [Crawfis93], the vectors' opacity depend- draw particles which lie within a specified distance D ofed on their magnitude, so only the regions of highest ve- the contour surface of interest.locity were emphasized. In this paper we take the region ofinterest to be on or near a contour surface. The scalar func- We assume that the vector field V(x, y, z) and the sca-tion being contoured can come directly from the vector iar functionf(x, y, z) are definedon the same rectilinear lat-field, for example, the vector magnitude or a vector corn- tice. To estimate the distance d(x, y, z) of a particle at (x, y,

Page 6: AIIM +/67531/metadc1312465/... · ,-°+ +,_ AIIM ,,_ _ + UCRL-JC-116231 PREPRINT Visualizing 3D Velocity Fields Near Contour Surfaces , N. Max, R. Crawfis._, C. Grant This paper was

z) from the contour surfacer(x, y, z) - C, we use a tech- is oriented near the viewing direction. Because these semi-nique described by Levoy [Levoy88]. We approximate the transparent particles are sent through the graphics pipelinegradient Vf(x, y, z) by finite differences of the neighboring after the opaque objects, they can be combined withvertex values off, and store the magnitude IVf(x, y, z)l. opaque contour surfaces in the z-buffer and be appropri-Then ately hidden. Currently they are all the same color, so they

d(x,y,z, = If(x' Y' .z) -_)_[ do not need to be sorted. (See [Max93].) Figure 1 shows aI IVf(x, Y, collection of ellipsoidal motion-blurred particles near a

where the quantitiesf(x, y, z) and IVf(x, y, z)l are trilinearly contour of velocity magnitude on a "tornado" velocity datainterpolated from the eight surrounding lattice vertices, set. Figure 2 includes a contour surface of velocity magni-

tude, which hides some of the dots.

We wish to randomly deposit particles uniformly intothe region R where d(x, y, z) < D. Assuming the specified The implementation is in C++, usi_g SGI's inventordistance D is larger than the cell size in the lattice, the fol- for the user viewing interface. The values of C and D arelowing procedure does this efficiently. We mark all lattice controlled by sliders. On our office workstations withvertices which are within D of the contour surface, and Elan TM graphics, the actual texture mapping is done inthen mark all cells which have at least one marked vertex, software, but the same code automatically calls the hard-

These markings are updated whenever the user changes C ware texture mapping on the Onyx TM workstation in ouror D. We randomly insert a specified number N of particles Graphics Lab. We can thus get real time rotation and parti-in each marked cell, and render a particle at (x, y, z) only if cle motion on small data sets, and interactive performanced(x, y, z) < D. on large data sets.

The particles are kept in a linked list, which also con- Particle traces on 2D surfaces

tains their ages. They are moved in each time step by sec, The goal of this technique is to represent the magni-ond order Runge-Kutta integration, using velocities tude and direction of a vector field at each point on an ar-trilinearly interpolated from the lattice vertices. If a parti- bitrary set of surfaces (not necessarily a contour surface),cle moves hito an unmarked cell or out of the data volume,it is scheduled for deletion from the linked list. At each allowing long towlines to be easily understood, but with-

out having the visualization become too dense or tootime step, we also check that all marked cells still have N sparse at any point.particles, and add or delete particles as necessary.

The particle size, brightness, and opacity are all pro- To do this we try to draw long, evenly spaced particleportional to a factor b = s(d), which is equal to 1 for small traces. The beginning and ends of these traces do not nec-d and decrea.,es continuously to zero when d reaches D. essarily indicate a source or sink in the vector field. TracesThus the particles fade in as they first cross into R, and begin and end over the entire surface in order to keep afade out as they leave. Since a particle could randomly be nearly constant density of lines in the image. The particle

trace lines are broken into small segments of contrastingcreated near the contour surface to replace another particle color. The length of the segments represents the magnitudeleaving a cell, we actually take b = minimum(s(d), ka), of the vector field (i.e. a constant time interval). The direc-where k is a constant and a is the age of the particle. Thismakes new particles fade in at birth. They are similarly tion of the segments is the direction of the vector field at

that point projected onto the 2D surface. In still pictures,faded out when deleted, using a sawtooth shaped color map across each segment

As in [vanWijk93], we draw the particles as blurred resolves the directional ambiguity of the lines. We experi-ellipses, stretched out in the direction of motion. However merited with several different projections of the vectorwe do the compositing using the hardware in our SGI field to the surfaces.workstations. A single blurred disk is used as the texture,

Once the particle traces are calculated and rendered,and is mapped to a 3D rectangle. If r is the radius of the color table animation can be used to add motion to the dis-

particle, P is its position vector relative to the viewpoint, play so that the lines "flow" in the direction of the vectorand V is its velocity vector, then the rectangle vertices are field with a velocity proportional to the magnitude of theat P + S + T, P + S - 7', P - S- 7",and P - S + T, where . vector field at each point. This flow animation was a pri-

V x P S x P mary goal of this technique. Color table animation is anS = rlV--V--_ and T = V + r_. old technique [Shoup79] which has been applied to flow

Basically, T is along the velocity direction, but the second visualization by Van Gelder and Wilhelms [VanGelder92].term is added so that the particle will shrink to a smallround dot of radius r when the velocity approaches zero or

Page 7: AIIM +/67531/metadc1312465/... · ,-°+ +,_ AIIM ,,_ _ + UCRL-JC-116231 PREPRINT Visualizing 3D Velocity Fields Near Contour Surfaces , N. Max, R. Crawfis._, C. Grant This paper was

The first step in this technique is to scan convert the projection, while being very straightforward, can yieldsurfaces into an octree. A piecewise linear representation very nonintuitive particle traces. Figure 3 shows the torna-of the 2D surface(s) is stored in the octree. Each cell holds do surface ina vector field in which all vectors are in ex-a plane equation (four numbers), The octree allows us to actly the same direction, pointing to the upper right at 45use any kind of surface (as long as the surface does not degrees. The uniformity of the vector field is not at all ap-pass through any cell twice). The octree allows fast access parent with this projection.to adjacent cells but is much more memory efficient than afull 3D grid. Only those cells that intersect the surfacesare XY Normal Projectionpresent in the octree. In this implementation, the surfaces The xy normal projection technique is designed forare subdivided down to a constant size cell. producing film loops where the viewpoint is rotated about

the z (vertical) axis. In this technique the 3D vector is pro-A seed point is then chosen to try toplace the firstpar-ticle trace. The particle is advected along the surface in jected onto the surface in the direction of a vector whichboth directions, forward and backwards, using a variable consists of only the x and y components of the surfacenor-step size Euler's method. We continue to advect the parti- real at that point. As can be seen in figure4, this preservescle until it reaches a stagnation zone, reaches an edge of the z component of the vector field and gives a somewhatthe surface, or becomes too close to its own trace or that of more intuitive visualization, but the uniformity of the vec-

tor field is still not readily apparent.another particle. The particle trace is considered accept-

able if it is longer than the current length threshold. If the Cylinder Projectiontrace is too short, it is erased and a new seed point is tried.

The length of the erased trace is preserved in the cells in The cylinder projection technique is also designed forwhich it passed. This value is used to prevent extensive re- producing film loops where the viewpoint is rotated aboutcalculation while backtracking, the z (vertical) axis. In this technique the 3D vector is pro-

jected onto the surface in the direction of a vector whichThe seed points are chosen on an integer lattice in a points away from the rotational axis. As can be seen in fig-

spatially hierarchial manner so that the first particle traces ure 5, this gives results very similar to the xy normal pro-will start well away from each other and are likely to be jection. This projection is only suitable for simple surfacestraced for long distances before getting too close to other which are centered on the rotational axis.lines. Random placement of seed points would also be

likely to yield long lines for the first points chosen, but Eye Projectionwould not guarantee that some seed point was near everypoint on the surfaces. All seed points, at some particular In the eye projection technique, the 3D vectors areresolution, are tried first using a large length threshold, projected onto the surfaces in a direction parallel to theThen the length threshold is reduced and the process is re- viewing direction. As shown in figure 6, for a single imagepeated. Gradually reducing the length threshold from this technique produces the most intuitive representationsome maximum to minimum produces the most esthetical- of the constant direction vector field. The uniform direc-ly pleasing distribution of particle traces, but takes longer tion of the vector field is readily apparent. When changingto calculate than using a single length threshold value, the viewpoint for a film loop, the projection of the 3D vec-

tors to the surfaces changes, resulting in a different set of

Proiections particle traces. Weattempt to minimize the visual effect of, these changes by using the same set of trial seed points as

Four techniques were tried for projecting a 3D vector the previous frame, and by starting each particle trace withonto the 2D surface. Three techniques, normal, xy normal the same "phase" as a nearby trace in the previous frame.and cylinder projections, are viewpoint independent. The As can be seen on the video, there is a certain amount ofeye projection technique is viewpoint dependent. View- jumpiness or flashing when this technique is used in ani-point dependent techniques require the particle traces to be marion, which is not present with the viewpoint indepen-recalculated each time the viewpoint is changed, while dent techniques.

viewpoint independent techniques do not require this re_ In conclusion, the uniformly spaced, animated parti-calculation, cle traces are an effective means of visualizinga 2D vector

Normal Projection field, but the projection of a 3D vector field onto a 2Dcurved surface loses and distorts much of the information

With the normal projection technique, the 3D vector from the 3D field, limiting the usefulness of these tech-at a point on the surface is projected onto the surface in a niques for 3D.direction parallel to the surface normal at that point. This

Page 8: AIIM +/67531/metadc1312465/... · ,-°+ +,_ AIIM ,,_ _ + UCRL-JC-116231 PREPRINT Visualizing 3D Velocity Fields Near Contour Surfaces , N. Max, R. Crawfis._, C. Grant This paper was

Fiber Bundles Figures 5 through 7 represent a volume rendering ofthe aerogel data, this time with a varying primary cob_r.

Fiber bundles use the back-to-front compositing and The color represents velocity magnitude. Figure 5 wassize scaling of splatting to construct a volume of tiny line generated with no transparency, creating in essence ansegments. Taken as a whole, these line segments construct etched isocontour.Figure6 adds transparency, and Figurethe appearance of a fibrous volume. While drawing many 7 addsa geometric representation of the filterparticles.tiny vectors to represent a vector field is not new, we havecombined this idea with back-to-front compositing and Hairstechniques to generate anisotropic textures. Our basic im-plementation plan is to extend the concept of splats - each We tried to use the fiber bundles to represent the flowdata point is composited into the frame buffer ina back-to- around or near a surface. This broke down when the flowfront manner, Rather than trying to reconstruct a C 13D was slightly into the surface. A solution is to grow tinysignal, we want a very discontinuous, yet antialiased, 3D hairs coming out of the surface. We draw the line seg-volume representation. At each data point, a collection of ments out of the surface first and then have them bend inantialiased lines is splatted. The lines are randomly scat- the flow field,much like normal hair. Several controls overtered within a 3D bounding box associated with each splat, this behavior are offered. The physical layout of the hairsThe hue, saturation, value and center position within the are specified by a number of connected line segments, bybox are all randomly perturbed. The direction of each line an interpolation of the normal vector and the velocity vec-is in the direction of the flow field.The jittering of the col- tot, and by a stiffness or weighting factor per segment. Theor and position produce a nice anisotropic textureoriented default number of segments is six, and all of the imagesin the direction if the flow field, even when the lines are so here were generated using only six segments. The interpo-dense that there is no space between them. The primary lation is completely specified by the user with coefficientscolor about which we jitter can be different for each splat t i at each line segment point. A new directional vector isor can be fixed for the entire volume. Having different col- generated using the formula: Direction = wi * ( ti * Nor-ors per splat allows us to encode additional information real + (l-ti) * Velocity* Velocity_Scale).The Normal vec-about the volume, either the vector magnitude, some sepa- tot is normalized, and the velocity is scaled by the userrate scalar field, or a positional indicator. Using a single parameter Velocity_Scale. Smooth curves or sharp bendsprimarycolor allows us toprecompute the line bundle into can be specified with the proper ti'S. The Direction vectora GL object, which is then very rapidly reoriented and re- is then added to the endpoint of the last line segment. Thedrawn at each data point. Fiber bundles in excess of over weighting by wi is useful to control the apparent stiffness300 line segments can be used for each data point with no of the hair. Greater weights can be given to the initial seg-degradation in real-time performance, ment in the direction of the normal, lower weights to the

middle segments and finally, large weights can be given toThree key issues are addressed in these fibrous vol- the last one or two line segments toproduce longer hairs in

umes: back-to-front compositing for a thin wispy-like ap- the velocity direction. This defines an individual hair. Apearance, antialiased lines with transparent heads and tails number of hairs are scattered throughout the splat volumeto avoid unwanted edges, and controlled jittering of colors and jittered from one splat to the next. The splats are posi-and positions to avoid regular patterns or completely filled tioned near the contour surface by the method of Levoyregions. Figure 7 shows a sample tornado data set using a discussed above.homogenous color that is heavily jittered. A zoomed inportion of the image is to the left of it. Notice the antialias- The color and transparency of the hairs are controlleding and lack of any hard edges. Figure 8 shows the wind by a weighted function of the hairs root color, a specifiedfield over North America in a simulated global climate splat color, a vector head color, and an HSV space jitter-model. Data pointsclose to the isocontour surface of a par- ing. The user specifies a root color and a vector head color.ticular wind velocity magnitude were chosen for the fiber A splat color is derived from a scalar field to color tablebundle splatting. Figures 9 and 10 represent the airflow mapping. At each segment, the user can specify the frac-through a filter substrate known as aerogel. For figure 9, tion of the root color, the fraction of the splat color, and thethe data points were again chosen to lie close to the sur- fraction of the vector head color that the endpoint of thatface of the filter particles. This provides a nice mossy ap- segment should be. A random jitter is added to this finalpearance. In Figure 10, the points were chosen near a color. The jittering is controlled by a scale factor for eachvelocity contour, and are color coded by velocity, giving a component. All computations are performed in HSVsolid volume with a fibrous texture. These images can be space, with the hue wrappingaround from one to zero, andgenerated in real time on a mid- to high-end graphical the saturation and value components clamped at zero andworkstation, one. A transparency value is also specified at each seg-

ment. No jiuering is applied to this.

Page 9: AIIM +/67531/metadc1312465/... · ,-°+ +,_ AIIM ,,_ _ + UCRL-JC-116231 PREPRINT Visualizing 3D Velocity Fields Near Contour Surfaces , N. Max, R. Crawfis._, C. Grant This paper was

Figure 11 shows our tornado with very sparse andopaque hairs. With these settings you can clearly see thehairs coming from the normal direction and bending intothe velocity direction. Figure 12 has more hairs that aremuch more transparent.

Acknowledgments

This work was performed under the auspices of theU.S. Department of Energy by Lawrence Livermore Na-tional Laboratory under contract number W-7405-ENG-48, with specific support from an internal LDRD grant.Barry Becker helped with some of the programming anddebugging.

References

[Cabra193] Brian Cabral and Lieth Leedom, "Imaging vectorfields using line integral convolution," Computer Graphics

• Proceedings, Annual Conference Series, ACM Siggraph,New York(1993) pp. 263 - 270

[Crawfis92]RogerCrawfisand Nelson Max. "Direct volume vi-sualizationof threedimensional vector fields," Proceedings,1992 Workshopon Volume Visualization, ACM Siggraph.New York(1992) pp. 261 - 266

[Crawfis93]RogerCrawfisand Nelson Max, "Texturesplats for3D scalar and vector fieldvisualization," Proceedings, Visu-alization '93, IEEEComputer Society Press, Los Alamitos,CA (1993)pp. 261 - 266

[Forsel193]Lisa):orssell,personal communication

[Shoup79] Richard Shoup "Color table animation," ComputerGraphics Vol. 13 No. 4 (August 19"/9)pp. 8 - 13

[Levoy88] MarkLevoy, "Display of surfaces fromvolume data,"IEEE Computer Graphics and Applications Vol. 8, No. 5(May 1988)pp. 29 - 37

[Stolk92] J. Stolk and J. J. van Wijk "Surface particles for 3Dflow visualization," in "Advances in Scientific Visualiza-tion," F. H. Post and A. J. Hin, eds., Springer,Berlin (1992)pp. 119- 130

[VanGelder92] Allen Van Gelder and Jane Wilhelms, "Interac-tive animated visualization of flow fields," Proceedings, 1992Workshopon Volume Visualization,ACM, New York(1992)pp. 47 - 54

[vanWijk91]J. J. van Wijk "Spot noise: texturesynthesis for datavisualization," Computer Graphics Vol. 25 No. 4 (July 1991)pp. 309- 318

[vanWijk93] J. J. van Wijk "Flow visualization with surface par-tides," IEEE Computer Graphics and Applications Vol. 13No. 4 (July 1993)pp. 18 -24

Page 10: AIIM +/67531/metadc1312465/... · ,-°+ +,_ AIIM ,,_ _ + UCRL-JC-116231 PREPRINT Visualizing 3D Velocity Fields Near Contour Surfaces , N. Max, R. Crawfis._, C. Grant This paper was

Figure 1. Spot noise near contour surface. Figure 2. Spot noise with contour surface.

Figure 3. Normal Projection Figure 4. XY Norm',d Projection.

Figure 5. Cylinder Projection. Figure 6. Eye Projection.

Page 11: AIIM +/67531/metadc1312465/... · ,-°+ +,_ AIIM ,,_ _ + UCRL-JC-116231 PREPRINT Visualizing 3D Velocity Fields Near Contour Surfaces , N. Max, R. Crawfis._, C. Grant This paper was

'IP

Figure 7, Line bundle tornado with magnitication.. Figure 8. Lme bundles near wmd veloctt_

D

Figure 9 Line bundle near aerogei surface... Figure 10. Lme bundle near veh_:tt) ctmtt_l,

Figure 11. Hair on velt_:lty contour of torn'ado. Ftgure 12 Fmer hair _n tornado vcloctt_

Page 12: AIIM +/67531/metadc1312465/... · ,-°+ +,_ AIIM ,,_ _ + UCRL-JC-116231 PREPRINT Visualizing 3D Velocity Fields Near Contour Surfaces , N. Max, R. Crawfis._, C. Grant This paper was

IT/ m

Page 13: AIIM +/67531/metadc1312465/... · ,-°+ +,_ AIIM ,,_ _ + UCRL-JC-116231 PREPRINT Visualizing 3D Velocity Fields Near Contour Surfaces , N. Max, R. Crawfis._, C. Grant This paper was