MEL Lab 3
-
- TEXT SET:
-
- (1) Write a global procedure "putText(
float $xpos, float $ypos, float $zpos, float $size, string $text
)" that calls "textCurves" and places it in various
spots on the screen. Save it to disk to be sourced. Make the
sourcing and running of it a button that resides on a shelf.
-
- (2) Write a dialog box (window) containing
sliders for the first four variables and a button to execute
a command. Pressing the button should call your "putText"
procedure. Your name should be the text being displayed.
-
- (3) Write another procedure "randText(
$num )" that calls the procedure "putText" and
places the text "yourName" at random spots on the screen
in random sizes. Write it to disk to be sourced. Make the sourcing
and running of it a button that resides on a shelf. Label the
two buttons differently.
-
- (4) Write a dialog box (window) that has
$num as a slider variable and a button to execute "randText(
$num )". When you click the button, "$num" copies
of the text should appear on the screen in different places and
at different sizes.
-
- (5) Change #4 so that when you press the
button, you delete the old text on the screen before the new
text is written.
-
-
-
- BACK TO SPHERES AND CONES:
-
- (1) Write a MEL procedure that draws "$numObj"
evenly-spaced objects along the x-axis, where each object is
randomly chosen to be either a sphere or a cone. Create a float
slider that moves between 0.0 and 1.0. Manipulating this slider
should allow you to bias the probability of spheres and cones
being generated. I.e, if the slider reads 0.0, then only spheres
are created. If the slider reads 1.0 then only cones are created.
If the slider is 0.5, then an even distribution of both spheres
and cones should be created randomly on the line. Clicking a
button should allow the action to occur. Actually it should delete
all the objects that were there first and replace them with new
ones. Multiple clicks of the button with the slider in the same
position should allow spheres and cones to pop onto and off of
the line.
-
- (2) Do the same as #1 except have all the
spheres at the end of the line and all the cones at the beginning
of the line. Remove randomness. When the slider is 0.0, we will
see all spheres as before. As the slider moves to the right,
cones emerge on the left side of the line. When the slider is
fully to the right, we only have cones. Send the command without
the button. That is, query the slider to see if the value has
changed and execute the command when it has and only when it
has. The result should be an animated line of spheres and cones
that responds to the changing of the slider.