Modifying and extending the basic vector field program.
To do these exercises you must
run
DX and the vector field program.
When the image window appears,
click on the Windows menu of the Image window and select the
Open VIsual Program Editor (VPE) item. The program source should appear.
Remember that you can get help in DX
on any module by selecting the "context sensitive
help" item from the help menu, then clicking the left mouse button on a module.
- Make the streamline diameter proportional to the vector magnitude.
- Disconnect the Tube and the Color module below it.
- Add a Compute module by:
- Clicking on the Transformation Catagory at the upper-left
side of the VPE.
- Clicking on the Compute item of the list in the lower-left
side of the VPE.
- Clicking below the Tube module to
place the new Compute module.
- Add a RubberSheet module by:
- Clicking on the Realization Catagory at the upper-left
side of the VPE.
- Clicking on the RubberSheet item of the list in the lower-left
side of the VPE.
- Clicking below the Compute module to
place the new Rubbersheet module.
- Add a Normals module by:
- Clicking on the Rendering Catagory at the upper-left
side of the VPE.
- Clicking on the Normals item of the list in the lower-left
side of the VPE.
- Clicking below the RubberSheet module to
place the new Normals module.
- The Normals module is necessary because the RubberSheet
module does not calculate lighting information.
- Connect the output of the Tube module to the Compute module.
- Connect the output of the Compute module to the RubberSheet module.
- Connect the output of the RubberSheet module to the Normals module.
- Connect the output of the Normals module to the Color module.
- Double-click the Compute module and enter the string
mag(a) in the "expression" field.
- Execute the program by selecting the Execute Once item from
the Execute menu.
The program should now look like
this,
(with the Compute dialog box open)
and
will generate an
image with variable diameter streamlines.
- Grow the streamline as a time sequence.
- Add a Compute module by:
- Clicking on the Transformation Catagory at the upper-left
side of the VPE.
- Clicking on the Compute item of the list in the lower-left
side of the VPE.
- Clicking above the StreamLine module to
place the new Compute module.
- Add a Sequencer module by:
- Clicking on the Special Catagory at the upper-left
side of the VPE.
- Clicking on the Sequencer item of the list in the lower-left
side of the VPE.
- Clicking above the Compute module you just added to
place the new Sequencer module.
- Double-click the Sequencer module to show the sequencer
widget.
- Connect the output of the Sequencer module to the Compute module.
- Connect the output of the Compute module to the fourth
input ("head") of the Streamline module.
- Double-click the Compute module and enter the string
a*5 in the "expression" field. This factor of five scales
the time so that the streamlines move at a reasonable rate.
- Execute the program by clicking the play icon on the sequencer
widget.
The program should now look like
this,
and
will generate one time step
image in which different streamlines have different lengths depending
on the local field strength (treating the field as a "velocity"). An
mpeg animation shows
about 43 frames.
- Color vector glyphs by their magnitude
- Disconnect the Autoglyph and the color module below it.
- Add a Compute module by:
- Clicking on the Transformation Catagory at the upper-left
side of the VPE.
- Clicking on the Compute item of the list in the lower-left
side of the VPE.
- Clicking below the Autoglyph module to
place the new Compute module.
- Add a ColorMap module by:
- Clicking on the Special Catagory at the upper-left
side of the VPE.
- Clicking on the ColorMap item of the list in the lower-left
side of the VPE.
- Clicking below the Compute module you just added to
place the new Colormap module.
- Connect the output of the Autoglyph module to the Compute module.
- Connect the output of the Compute module to the first
input of the ColorMap module and to the first input of the
Color module.
- Connect the output of the ColorMap module to the second
input of the Color module.
- Double-click the Compute module and enter the string
log(mag(a)) in the "expression" field. This expression
log-compresses the large data range so that the a color range is
easier to see.
- Execute the program by clicking the play icon on the sequencer
widget.
The program should now look like
this,
and
will generate an
image in which the vector glyphs have a color range.
- 2D slice of the 3D field.
We will slice the 3D field to show 2D methods, but you could clearly use the
same techniques for fields which were originally 2D. The presentation of
methods will be somewhat compressed.
- Add the following modules (refer to the
program for module placement):
- A Slice module from the Import/Export catagory.
- A Reduce module from the Import/Export catagory. Set
the factor to 2.
- A Autocolor module from the Transformation catagory.
- An Autoglyph module from the Annotation catagory.
- A Color module from the Transformation catagory. Set
the "color" field in the module dialog box to
"black".
- A Collect module from the Structuring catagory.
- A Image module from the Rendering catagory.
- Connect the modules as shown in the link above. The wire coming
in the top of the program fragment is from the import module.
- Execute the program by selecting the Execute Once item from
the Execute menu. A new image window will appear with a 2D slice in it.
The program should now look like
this,
and
will generate an
image in which the vector glyphs are black and the background is colored
by the vector magnitude.