STEPS NEEDED TO RUN THE VRML 3D GRAPHIC PROGRAMS ================================================ o To create a 3D graphic you need to do these things: (1) Obtain a data set that has the X, Y, and Z data in the form of columns. The columns need not be in any order, and can include text columns, so long as no columns contain any internal blanks. In can include comment lines, however, which contain the string "//". An example of such a raw data file (we will call it "heart.raw") is: //age sex heart exer teacher aero 28 1 86 2 Yang 36.6 41 1 76 3 Yang 26.7 30 1 78 2 Yang 33.8 39 2 90 1 Yang 13.6 28 1 96 1 Yang 33. 26 1 74 2 Yang 42.7 48 2 72 2 Yang 22.6 31 1 60 3 Yang 44.1 (2) Identify which columns are to be the X, Y, and Z coordinates. In the above case, we might decide that: Age (column 1) is the X coordinate Aero (column 6) is the Y coordinate Heart (column 3) is the Z coordinate (3) Create a file named "vrml.hdr" which contains some header information for the graphic in terms of (a) the type, size, and color of the representations of the data points. The allowable types are: sphere (e.g., type=sphere, radius=1 ) cone (e.g., type=cone, height=4, width=3 ) cylinder (e.g., type=cylinder, radius=1, height=4) box (e.g., type=box, size=4 ) text (e.g., type=text, size=5, string=abc def gh ) (b) The columns where the coordinates are (c) The names that identify each axis. (d) The color of each axis, and the number of grid lines/axis (e) Any title or legend information For example, for the "heart.raw" data file, the "vrml.hdr" file might look like this: // Data and Axis information type=cone,width=3,height=4,color=yellow xcol = 1, ycol = 6, zcol = 3, Xcolor=white, Xgrid=3, Xname=AGE Ycolor=white, Ygrid=9, Yname=Aerobic Zcolor=white, Zgrid=9, Zname=Heart rate // Title type=text,color=white,x=50,y=150,z=0,size=11,string=Aerobic Efficiency type=text,color=white,x=50,y=140,z=0,size=11, string=by Age:Heart Rate // And here we add a legend: type=cone, color=red, x=0, y=120, z=0, height=4, width=3 type=text, color=red, x=10, y=120, z=0, size=9, string=:Males type=cone, color=yellow,x=0, y=130, z=0, height=4, width=3 type=text, color=yellow,x=10, y=130, z=0, size=9, string=:Females Note that the lines: "//Data and Axis information" and "// Title" are necessary and CANNOT be omitted (4) Run the program "vrml.pre" to prepare the data for the main graphics program, as follows: mead% vrml.pre < heart.raw > heart.data This creates a data file named "heart.data" that is ready, or nearly ready, to be plotted. (5) Edit the ".data" file (in the above case "heart.data") to make any changes you wish to make to the data representations. For example, you may wish to make one data value appear in blue and of a larger size to emphisize it (6) Then run the program "vrml.prl" to create the final VRML file: mead% vrml.prl < heart.data > heart.wrl The file heart.wrl can now be displayed as a VRML file on the WWW. Simply drag the file over any Internet Explorer or Netscape window, provided that you have the Cosmo Player 2.1.1 or above installed on your PC, and you can then manipulate the image.