Lake Michigan Flow Field Visualization

Data Conversion Process

The Lake

The lake was created by using an elevation grid. This was done by first scaling the data that was given in the mich5.dat file, and then placing it inside an elevation grid. A Perl script was also used to create the coloring for the grid based on the depth using a numerical formula. This script generated a color value for each of the 5406 grid squares.

Elevation Grid Sample Listing:

#VRML V2.0 utf8 
Shape {
	appearance Appearance {
		material DEF M Material {}
	}
	geometry ElevationGrid {
		solid         FALSE
		xDimension    53
		xSpacing      1
		zDimension    102
		zSpacing      1
		height        []
		color Color {
			color []
		}
	}
}
                



The Flow Field

The flow field was created by first using a Perl script to arrange the x-y-z in the VRML 2.0 syntax. VRML uses a righthand coordinate system, where the horizontal (across the screen) is considered the x direction, the vertical (up and down on the screen) is considered the y direction, and the into and out of the screen is the z direction. The Perl script read in the data, the xyz.dat file, and then rearranged the coordinates as they were given [1] [2] [3], and printed them as [1] [3] [-2], where [3] was scaled by a factor. In the data set that was given to us the [3] position, representing the depth had a negative sign. However, in VRML into the screen is a negative direction and out of the screen a positive, hence the sign change.

The data given to us represented the location of every particle, at each of the 480 time-steps. However, until they are released each of the particles is at the point at which it will be released. Therefore, the particles released at the first time-step all of their locations are needed, and for the particles released at the second time-step all of the locations are needed accept those that occur during the first time-step. This works into the algorithm which says that the locations of interest for the nth set of three particles are their locations at the 480-n time-steps. This allows for one half of the locations given in xyz.dat to be eliminated, or approximately 6.5 MB. A Perl script was used to edit the revised version of xyz.dat into a VRML 2.0 file by creating arrays for the particles that were released at during the same time-step. Each of these 480 arrays made up the key values for a coordinate interpolator. The Perl file put these arrays into the coordinate interpolators, created the keys, routing statements, and index point sets that created this flow simulation.

Coordinate Interpolator Sample Listing:

#VRML V2.0 utf8 
DEF TIMER TimeSensor {
        cycleInterval 80
        loop TRUE
}

DEF COORINTERP_n CoordinateInterpolator { 
        key []
        keyValue []
}

Shape {
        appearance Appearance {
                material Material {
                        diffuseColor		1 1 1
                        emissiveColor		1 1 1
                        shininess		1
                        ambientIntensity 	1
                }
        }
        geometry PointSet {
                coord DEF WAVE-COORD_n Coordinate {
                        point [ 0 0 0,
                                0 0 0,
                                0 0 0 ]
                }
        }
}

ROUTE TIMER.fraction_changed TO COORD-INTERP_n.set_fraction
ROUTE COORD-INTERP_n.value_changed TO WAVE-COORD_n.set_point


Last Update: January 9, 2003, kpb
Return to Lake Michigan Flow Field Visualization