|
|||||||||||||||||
![]() |
MEL Day 4 Homework |
||||||||||||||||
| Using what we have learned so far, I'd like you to write a "scatter" program that will take a selected list of elements and randomly scatter them based on their current position. In class on Thursday I showed you how to start a procedure and pass it arguments at runtime. If you missed class or do not remember how to do this, I've included a "getting started" portion at the bottom of this page. In the first option you have the user feed 2 argument floats and the scatter will be based off of these min and max values. In the second option you have the user provide a single number and you use the sphrand function to generate a random vector to use for the offset. Review the course notes and Maya Help documentation for more information.
Getting Started: replace the ## in the proc name with your initials. (ie. mh_scatter...) proc ##_scatter( float $minValue, float $maxValue ) {
float $randValue = rand( $minValue, $maxValue ); print ( "Offset random is: " + $randValue + "\n" ); // The rest of your code goes here... } - or - proc ##_scatter( float $randRadius ) {
vector $randValue = sphrand( $randRadius ); print ( "Offset radius is: " + $randValue + "\n" ); // The rest of your code goes here... } |
|||||||||||||||||
![]() |
|||||||||||||||||
![]() |
|||||||||||||||||