and then to rearrange the new Xterm window and the Fungimol graphics window so they do not overlap. The Xterm window will not have any interesting text yet, but the Fungimol graphics window will have a large black expanse with something like this in the lower left corner:xterm -e fungimol &
This initial scene is simply some test data. It is a collection of 539 balls which are affected by gravity and can bounce off of each other and some invisble planes. They aren't moving yet because we have not yet given the command that starts time.![]()
There is a user interface bug here with an easy workaround. The mouse must be over the Fungimol window when you press the control key, otherwise Fungimol will ignore the control key. Another bug is that you have to press the control key before pressing the middle mouse button.![]()
Control-middle-mouse rotates the scene as though there were a virtual trackball. The center of the scene is the center of the trackball, except that if something is selected (see below), the center of the selection is the center of the trackball. If the mouse is less than 200 pixels from the center, then moving the mouse rotates the trackball as though the mouse were translating an infinitely large flat hand that was rolling the trackball around. If the mouse is more than 200 pixels from the center, rotating the mouse around the center of rotation twists the scene around its center. For instance, if the balls are in the center of the screen and you start with the trackball in the lower right corner and drag it in a circular arc to the upper right corner, you might wind up with something like this:
and then to position the mouse at the upper left corner of the image of the blue balls, press the left mouse button, drag it to the lower right corner of the image of the blue balls, and release the left mouse button. The blue balls will start blinking:![]()
The left, right, top, and bottom of region that is selected in space is determined by the rectangle swept out by the mouse. The region of space also has a minimum and maximum depth. The minimum depth is the depth of the nearest object that was inside the rectangle swept out by the mouse, and the maximum depth is equal to the minimum depth plus the width or height of the rectangle swept out by the mouse, whichever is larger.![]()
We can use this limited depth to select just a few of the blue balls. To see this, first click anywhere on the black background with the left mouse button to deselect everything, then drag with the left mouse button from the middle of the image of the cube of blue balls to the lower right corner. You'll probably select 8 of the blue balls:
Clicking the left mouse button selects one object, since a click is a zero-size drag.![]()
Using shift-right-mouse changes the depth of the selection. If the mouse goes up and down, the selected objects move further or nearer to you; if the mouse goes left and right, the selection translates to the left or right, just as though you were using right-mouse. Unfortunately there are not enough depth cues in the scene, so changing the depth of the selection is completely invisible unless the move changes which objects are in front of other objects. For example, we can provide the depth cue by using right-mouse to translate the selected cube of blue objects so it is in the middle of the cube of red objects:![]()
and then we can drag upward with shift-right-mouse to increase the depth of the blue objects so they sink down further into the red cube:![]()
Another, less disruptive, way to provide the depth cue is to use control-middle-mouse to rotate the point of view after you've changed the depth of an object.![]()
Control-right-mouse rotates the selection, and it shares most of the code with control-middle-mouse rotating the point of view. For instance, if we use right-mouse to move the blue cube back to its previous position at the left of the red cube, then release the right mouse button, then we can use control-right-mouse to rotate the blue cube:
The need to release the right mouse button here is a user interface bug. If you didn't release the right mouse button, the control key would have been ignored.![]()
After creating a copy, it is generally a good idea to move the copy off of the original, since interpenetrating objects are confusing and the laws of physics tend to object to them. However, for the purposes of this tutorial we can just move on to the next section.![]()
If the mouse is over an object, information for that object is printed; it may look like this:
If one object is selected, and the cursor is over an object, then the distance between the selected object and the object under the cursor is also printed:The cursor is pointing at object 518 which is a BouncingBall at position (3.634542, 0.274381, 16.779156) with no links
Last, if the cursor is not pointing at any object, the program will tell you how many objects are selected. For example, after selecting the entire scene, this message is possible:The cursor is pointing at object 518 which is a BouncingBall at position (3.634542, 0.274381, 16.779156) with no links The distance from selected object 517 is 1.999999
539 objects selected
If you start time when there are interpenetrating objects, then they'll tend to move quite violently. For this scene, be aware that there are four invisible planes that these balls bounce off of; it is quite easy to cause a ball to interpenetrate one of these invisible planes.
Here's what the bouncing balls look like after a little bit of time passes:
After you get tired of watching the balls bounce, press "s" to stop time, press "n" to get a new scene (so the balls will be nice and tidy again), select all of the balls, and delete them. This will leave the scene empty. Then you can move on to the next chapter of the tutorial.![]()