In a previous section we saw how to add and position a single plant model. Let's use the power of scripting to quickly fill the piazza with plants. Copy and replace your code with the following:
Run the script and you'll see with four lines of code you are able to create 20 plants and place them in exact locations. You can probably guess that the same four lines could just as easily create 600 plants. That's just a glimpse of the power of scripts.
We can specify an object's orientation with yaw, pitch and roll like we did for the viewpoint using the node3D.setEuler command. Add the line that's highlighted (make sure it's also indented as shown below) and run the script:
So far we've manipulated position and orientation, two aspects of an object's transform. The third aspect, scale, can be changed with the <node3D>.setScale command. This command takes 3 scale factors that are applied independently to each of the three dimensions. For example, the result of the following line would be a uniform scaling (same across all dimensions) and a plant that's 50% of it's original size:
Add this line after the setEuler command line in the for loop (same indentation) to see the effect of scaling. Try experimenting with some different scale factors and non-uniform scaling.