Modifying and extending the basic particle program.
To do these exercises you must
run
DX and the particle program.
If you use this launcher, then you will have open the Sequencer and Image
windows. 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.
- Add a caption.
- Add an input tab to the Collect module by selecting it with
a mouse click, then typing control-A.
- Add a Caption module by:
- Clicking on the Annotation Catagory at the upper-left
side of the VPE.
- Clicking on the Caption item of the list in the lower-left
side of the VPE.
- Clicking to the right side of the Collect module to
place the new Caption module.
- Connect the output tab of the Caption module to the new input
of the Collect.
- Double-Click the Caption module and type a test caption into
the "string" field.
- Execute the program by selecting the Execute Once item from
the Execute menu.
The program should now look like
this,
(with the Caption dialog box open) and
will generate an
image with a caption. You can change the position of the caption in the
image by modifing the position parameter which defaults to the bottom-center
of the image.
- Make a caption which shows the time step.
- Add an input tab to the Collect module by selecting it with
a mouse click, then typing control-A.
- Add Caption and Format modules by:
- Clicking on the Annotation Catagory at the upper-left
side of the VPE.
- Clicking on the Caption item of the list in the lower-left
side of the VPE.
- Clicking to the right side of the Collect module to
place the new Caption module.
- Clicking on the Format item of the list in the lower-left
side of the VPE.
- Clicking above the just-added Caption module to
place the new Format module.
- Connect the output tab of the Caption module to the new input
of the Collect.
- Connect the output tab of the Format module to the first input
of the Caption.
- Connect the output tab of the Sequencer module to the second input
of the Format.
- Double-Click the Format module and type
"Time Step=%d" into the "template" field.
- Execute the program by clicking on the foward play button on the
Sequencer.
The program should now look like
this,
and
will generate an
image with a time-varying caption.
- Change the color of the disks.
- Disconnect the wire connecting the Glyph and Collect modules
by clicking on the end attached to the collect module and dragging
the wire off.
- Add a Color module by:
- Clicking on the Transformation Catagory at the upper-left
side of the VPE.
- Clicking on the Color item of the list in the lower-left
side of the VPE.
- Clicking to the left side of the Collect module to
place the new Color module.
- Connect the output tab of the Glyph module to the first input
of the Color module.
- Connect the output tab of the new Color module to the input
of the Collect.
- Double-Click the Color module and type a color name
(e.g. "red") into the "color" field.
- Execute the program by selecting the Execute Once item from
the Execute menu.
The program should now look like
this,
(with the Color dialog box open) and
will generate an
image with red disks.
- Make the particles look spherical.
- Double-Click the Gylph module and type "sphere"
into the "type" field.
- Execute the program by selecting the Execute Once item from
the Execute menu.
The glyph dialog box should now look like
this,
and will generate an
image with red disks.
- Add an interactor to set particle diameter.
- Add an input tab to the Compute module by selecting it with
a mouse click, then typing control-A.
- Add an Scalar module by:
- Clicking on the Interactor Catagory at the upper-left
side of the VPE.
- Clicking on the Scalar item of the list in the lower-left
side of the VPE.
- Clicking to the right side of the Compute module to
place the new Scalar module.
- Connect the output tab of the Scalar module to the second input
of the Compute.
- Double-Click the Scalar module to open a new control panel.
- On the control panel set the desired radius (e.g. 0.1)
- Double-click the Compute module and change the "expression"
to "b" (that is, make the output equal to input b).
- Execute the program by clicking on the foward play button on the
Sequencer. As the program steps forward change the interactor in
the control panel.
The program should now look like
this,
and will generate an
image with larger disks (if the interactor is set to 0.1).