newton - a physical modeling demo
newton [-f model_catalog] [-D]
Newton is a real-time simulation of an elastic body. Command-line
arguments will be discussed below, after a general explanation of the
The body is made up of a number of atoms and springs. Atoms are points
of mass for which the forces of gravity apply. Between some pairs of
atoms, there are springs, which supply additional forces if their current
length is different from their initial length. The specific spring
equation used is not linear, but behaves close to linear in a narrow
vicinity of the initial spring length.
The main window of Newton shows a cubic room that contains the elastic
model at its center. To drop the model, press and release the left mouse
button. Between the time you press the left mouse button and the time
you release it, you get a chance to reorient the model any way you want -
just move the mouse around and the model will turn in that direction.
Independently, you may wish to rotate the room. This can be achieved by
pressing the middle mouse button and moving the mouse around. To stop
reorienting the room, let go of the middle mouse button.
Whenever you want to re-drop the model, hit the left mouse button. As
before, you get a chance to reorient the model prior to dropping it (you
drop it by releasing the left mouse button).
MENUS [Toc] [Back]
As usual with the GL demo programs, the right mouse button is the menu
button. Several menu selections are available:
models There are a number of different models to select from, and a
different shape can be selected via the model catalog menu.
physics The simulation is controlled by several physical parameters,
and they can all be changed by the user. For example, if
the user wants to increase the gravity (essentially, make
the model heavier), all she has to do is select ``gravity''
in the ``physics'' submenu, and a gravity slider will pop
up. See the section on sliders below to find out what
physical parameters are available, and how to use the
The model can be displayed in several fashions:
Display the model as a single surface, using
the lighting model to obscure the corners of
flat surfaces The normal display mode for most models.
Every surface is lit independently;
springs Display the internal connections between the
``atoms'' of the model;
Bermuda This is a weird display mode using the color
map, try it!
NOTE: Only one of the above four is possible at any given
time, so if you are tired of the Bermuda display mode, the
way to return to a more normal display mode is to simply
select flat surfaces, smooth surfaces, or springs from this
The model can be made either opaque or
transparent. Consecutive selections of this
menu item toggle between these two
It is sometimes helpful to see both the
surfaces and the springs of the model at the
same time. If you have selected either flat
or smooth surfaces, and you want to
superimpose the springs, click this menu item.
Clicking it again cancels the springs. This
is particularly useful if the model is made
transparent, using the previous menu item.
room display This controls the way the room itself is drawn. Selections
are either lighted walls w/ shadows, which means the walls
are lit (just like the model itself,) and the model casts
shadows on them; lighted walls w/o shadows, which is faster
(since there are less polygons that need to be drawn); and
pinball walls , which are non-lit walls, but rather walls
that light up whenever the model hits them (the color
represents the amount of displacement).
spin mode on/off
As with many GL demos, there is a mode in which things
happen ``by themselves'' without user intervention. Turning
spin mode on causes the room to continually follow the
mouse, rotating in the mouse direction with a velocity
proportional to the distance from the mouse position to the
center of the screen (not the model window).
Quit Newton. Other ways of quitting include hitting the
ESCAPE key, and selecting quit from the menu bar.
SLIDERS [Toc] [Back]
A slider is a means of changing the value of some physical parameter of
the system. If the slider you need is not open already, you can open it
from the physics menu, as explained above. A slider is essentially a
window that shows the lowest, highest, and current values of the
corresponding physical parameter: the precise values appear in the lower
left, lower right, and lower middle of the slider window. A visual
interpretation appears above the numbers as a rectangle that is
partitioned into a green and yellow sections, which correspond to the
portion of the range below and above the current value, respectively.
Moving to any point within the graphic representation of the slider and
clicking the left mouse button will make the value corresponding to that
point become the current value of the slider. You can also slide the
value by using the middle mouse button in a manner analogous to rotating
the room (see above). The right mouse button brings up the slider menu,
which enables you to reset the slider to its default value, or close the
slider window altogether. Once closed, a slider window can be reopened
from the physics menu.
Available sliders are:
Gravity The magnitude of the gravity vector. It always points
down (in screen space).
Spring Constant [Toc] [Back]
The spring constant of the stiffest spring in the model.
Wall Stiffness The walls of the room are like trampolines, and that is
why the model bounces off of them. This parameter
controls the stiffness of those trampolines. The higher
the value, the harder the walls kick back. The lower the
value, the soggier the walls. The latter results in the
model ``sinking'' into the walls.
Wall Friction When the model hits a wall, it typically loses some energy
due to wall friction. This parameter controls which
fraction of the energy is lost. The higher the friction,
the more energy gets lost. Note that with high friction
the model often ``prefers'' ``jumping'' along a wall to
``sliding'' along it.
Air Dampening This parameter controls how much energy the model loses
simply by moving through the air that's inside the room.
When this value is high, it is as if the model is
surrounded by a viscos material (such as honey) rather
than air. When this value is zero, the model experiences
no air resistance whatsoever.
Display Step If you think of what you see on the screen as a movie,
this parameter controls which frames actually get drawn.
When the display step is 5, for example, only every fifth
frame (roughly) of the movie gets displayed. When the
value is high, the animation is usually faster and
jumpier. When the value is low, the movie is more smooth,
but has a feeling of slow motion.
COMMAND LINE ARGUMENTS [Toc] [Back]
The -D (demo-mode) option causes all the sliders to be opened (as well as
the main window) in pre-defined positions on the screen. Specifiying
``-f model_catalog'' causes the program to use an alternative list of
model shapes instead of the default ones. The serious user may
experiment with new model shapes once she managed to decipher the obscure
format of a model description file...
A model catalog is a list of model description file names. If a name is
not fully-qualified, it is considered relative to the directory
containing the model catalog file.
If the model_catalog is `-', it is taken to be the standard input. For
example, to have Newton run on all the ``*.j'' files in the current
working directory, you might use
echo *.j | newton -f -
HELPFUL HINTS [Toc] [Back]
There are many fun things to do with this program. However, remember
that certain combinations of physical parameters may cause the model to
break - very much as in real life. When the model breaks, there is no
need for panic: simply hit the left mouse button and you get a fresh
model that you can break again ...
You can kick the model by tilting the room so the lowest point is a
corner. Let the model come to a rest at that corner, and then rotate the
room around a horizontal axis - simply drag the mouse either up or down
rapidly with the middle mouse button pressed. The decision whether to go
up or down depends on the position of the low corner: if it is more to
the front (facing you) - go up, if it is facing away from you - go down.
Kicking normally introduces gobs of energy into the system, and some
models do not handle that very well. You may want to decrease wall
stiffness or increase spring constant before kicking.
Another fun thing is to see soggy walls: just push wall stiffness to a
very low value, and then drop the model. This is particularly visible if
you align the room so that the bottom wall is almost flat, but still
faces you a little (if a wall faces away from you - it automatically
becomes transparent) prior to dropping the model. When the model comes
to a rest, you may kick up the wall stiffnes (select the default wall
stiffness from the slider menu), and the model will soar to the sky as
fast as gravity and the air dampening enable.
Once you have mastered the user interface to this program, try to get the
chain model to hang in free space by its two endpoints. In other words,
get the room aligned so that there is an edge of the cube at the bottom,
and the two walls incident on that edge form a V-shaped corner. Then
drop the model. Wall friction and stiffness may help you overcome
inacuracies in the room alignment. Once the model hangs there, you can
gradually lower and raise the spring constant, lower and raise gravity,
or kick the wall stiffness - all of which will show amusing effects on
These are but a few of the possible experiments that can be carried out
using this simulation.
/usr/demos/General_Demos/newton/data the default list of model
/usr/demos/General_Demos/newton/data/*.j model description files
Self explanatory. Messages that appear on the terminal from which Newton
was invoked indicate a problem Newton is experiencing in performing the
simulation. Typically, this indicates an incorrect setup of either the
Newton program or the catalog or description files.
The bending of the walls is approximated by a crude pyramid. The sheet
model particularly suffers from that, so you have to have relatively
stiff walls to get a decent performance out of the sheet.
Yossi Friedman, June-August 1988. The idea is derived from the original
``Jello'' by Thant Tessman.
PPPPaaaaggggeeee 5555 [ Back ]