From http://www.jwz.org/xscreensaver/xscreensaver-5.22.tar.gz
[xscreensaver] / hacks / attraction.man
1 .de EX          \"Begin example
2 .ne 5
3 .if n .sp 1
4 .if t .sp .5
5 .nf
6 .in +.5i
7 ..
8 .de EE
9 .fi
10 .in -.5i
11 .if n .sp 1
12 .if t .sp .5
13 ..
14 .TH XScreenSaver 1 "14-Jun-97" "X Version 11"
15 .SH NAME
16 attraction - interactions of opposing forces
17 .SH SYNOPSIS
18 .B attraction
19 [\-display \fIhost:display.screen\fP] [\-foreground \fIcolor\fP]
20 [\-background \fIcolor\fP] [\-window] [\-root] [\-mono] [\-install]
21 [\-visual \fIvisual\fP] [\-points \fIint\fP] [\-threshold \fIint\fP]
22 [\-mode balls | lines | polygons | splines | filled-splines | tails ]
23 [\-size \fIint\fP] [\-segments \fIint\fP] [\-delay \fIusecs\fP]
24 [\-color-shift \fIint\fP] [\-radius \fIint\fP]
25 [\-vx \fIint\fP] [\-vy \fIint\fP] [\-glow] [\-noglow]
26 [\-orbit] [\-viscosity \fIfloat\fP]
27 [\-walls] [\-nowalls] [\-maxspeed] [\-nomaxspeed]
28 [\-correct-bounce] [\-fast-bounce]
29 [\-fps]
30 .SH DESCRIPTION
31 The \fIattraction\fP program has several visually different modes of 
32 operation, all of which are based on the interactions of a set of control
33 points which attract each other up to a certain distance, and then begin
34 to repel each other.  The attraction/repulsion is proportional to the 
35 distance between any two particles.
36 .SH OPTIONS
37 .I attraction
38 accepts the following options:
39 .TP 8
40 .B \-window
41 Draw on a newly-created window.  This is the default.
42 .TP 8
43 .B \-root
44 Draw on the root window.
45 .TP 8
46 .B \-mono 
47 If on a color display, pretend we're on a monochrome display.
48 .TP 8
49 .B \-install
50 Install a private colormap for the window.
51 .TP 8
52 .B \-visual \fIvisual\fP
53 Specify which visual to use.  Legal values are the name of a visual class,
54 or the id number (decimal or hex) of a specific visual.
55 .TP 8
56 .B \-points integer
57 How many control points should be used, or 0 to select the number randomly.
58 Default 0.  Between 3 and 15 works best.
59 .TP 8
60 .B \-threshold integer
61 The distance (in pixels) from each particle at which the attractive force
62 becomes repulsive.  Default 100.
63 .TP 8
64 .B \-mode "balls | lines | polygons | tails | splines | filled-splines"
65 In \fIballs\fP mode (the default) the control points are drawn as filled
66 circles.  The larger the circle, the more massive the particle.
67
68 In \fIlines\fP mode, the control points are connected by straight lines;
69 the effect is something like \fIqix\fP.
70
71 In \fIpolygons\fP mode, the control points are connected by straight
72 lines, and filled in.  This is most interesting in color.
73
74 In \fIsplines\fP mode, a closed spline is interpolated from the control 
75 points.
76
77 In \fIfilled-splines\fP mode, the splines are filled in instead of being
78 outlines.  This is most interesting in color.
79
80 In \fItails\fP mode, the path which each particle follows is indicated
81 by a worm-like trail, whose length is controlled by the \fIsegments\fP
82 parameter.
83 .TP 8
84 .B \-size integer
85 The size of the balls in pixels, or 0, meaning to select the sizes 
86 randomly (the default.)  If this is specified, then all balls will be 
87 the same size.  This option has an effect in all modes, since the ``size''
88 of the balls controls their mass.
89 .TP 8
90 .B \-segments integer
91 If in \fIlines\fP or \fIpolygons\fP mode, how many sets of line segments
92 or polygons should be drawn. Default 500.  This has no effect in \fIballs\fP
93 mode.  If \fIsegments\fP is 0, then no segments will ever be erased (this
94 is only useful in color.)
95 .TP 8
96 .B \-delay microseconds
97 How much of a delay should be introduced between steps of the animation.
98 Default 10000, or about 0.01 seconds.
99 .TP 8
100 .B \-color-shift int
101 If on a color display, the color of the line segments or polygons will 
102 cycle through the color map.  This specifies how many lines will be drawn
103 before a new color is chosen.  (When a small number of colors are available,
104 increasing this value will yield smoother transitions.)  Default 3.
105 This has no effect in \fIballs\fP mode.
106 .TP 8
107 .B \-radius
108 The size in pixels of the circle on which the points are initially positioned.
109 The default is slightly smaller than the size of the window.
110 .TP 8
111 .B \-glow
112 This is consulted only in \fIballs\fP mode.  If this is specified, then 
113 the saturation of the colors of the points will vary according to their
114 current acceleration.  This has the effect that the balls flare brighter
115 when they are reacting to each other most strongly.
116
117 In \fIglow\fP mode, all of the balls will be drawn the same (random)
118 color, modulo the saturation shifts.  In non-glow mode, the balls will
119 each be drawn in a random color that doesn't change.
120 .TP 8
121 .B \-noglow
122 Don't do ``glowing.''  This is the default.
123 .TP 8
124 .B \-vx pixels
125 .TP 8
126 .B \-vy pixels
127 Initial velocity of the balls.  This has no effect in \fB\-orbit\fP mode.
128 .TP 8
129 .B \-orbit
130 Make the initial force on each ball be tangential to the circle on which
131 they are initially placed, with the right velocity to hold them in orbit
132 about each other.  After a while, roundoff errors will cause the orbit
133 to decay.
134 .TP 8
135 .B \-vmult float
136 In orbit mode, the initial velocity of the balls is multiplied by this;
137 a number less than 1 will make the balls pull closer together, and a larger
138 number will make them move apart.  The default is 0.9, meaning a slight
139 inward pull.
140 .TP 8
141 .B \-viscosity float
142 This sets the viscosity of the hypothetical fluid through which the control
143 points move; the default is 1, meaning no resistance.  Values higher than 1
144 aren't interesting; lower values cause less motion.
145
146 One interesting thing to try is
147 .EX
148 attraction -viscosity 0.8 -points 300 -size 10 -geometry =500x500
149 .EE
150 Give it a few seconds to settle down into a stable clump, and then move
151 the drag the mouse through it to make "waves".
152 .TP 8
153 .B \-nowalls
154 This will cause the balls to continue on past the edge of the
155 screen or window.  They will still be kept track of and can come back.
156 .TP 8
157 .B \-walls
158 This will cause the balls to bounce when they get
159 to the edge of the screen or window.  This is the default behavior.
160 .TP 8
161 .B \-maxspeed
162 Imposes a maximum speed (default).  If a ball ends up going faster than
163 this, it will be treated as though there were .9  viscosity until it is
164 under the limit. This stops the balls from continually accelerating (which
165 they have a tendency to do), but also causes balls moving very fast to
166 tend to clump in the lower right corner.
167 .TP 8
168 .B \-nomaxspeed
169 If this is specified, no maximum speed is set for the balls.
170 .TP 8
171 .B \-fast-bounce
172 Uses the old, simple bouncing algorithm (default).  This simply moves any
173 ball that is out of bounds back to a wall and reverses its velocity.
174 This works fine for most cases, but under some circumstances, the
175 simplification can lead to annoying effects.
176 .TP 8
177 .B \-correct-bounce
178 Uses a more intelligent bouncing algorithm.  This method actually reflects
179 the balls off the walls until they are within bounds.  This can be slow
180 if balls are bouncing a whole lot, perhaps because of -nomaxspeed.
181 .TP 8
182 .B \-graphmode none | x | y | both | speed
183 For "x", "y", and "both", displays the given velocities of each ball as a
184 bar graph in the same window as the balls.  For "speed", displays the total
185 speed of each ball.  Default is "none".
186 .BR
187 .TP 8
188 .B \-fps
189 Display the current frame rate and CPU load.
190 .SH ENVIRONMENT
191 .B DISPLAY
192 to get the default host and display number.
193 .TP 8
194 .B XENVIRONMENT
195 to get the name of a resource file that overrides the global resources
196 stored in the RESOURCE_MANAGER property.
197 .SH SEE ALSO
198 .BR X (1),
199 .BR xscreensaver (1)
200 .SH COPYRIGHT
201 Copyright \(co 1992, 1993, 1997 by Jamie Zawinski.  Permission to use, copy,
202 modify, distribute, and sell this software and its documentation for any
203 purpose is hereby granted without fee, provided that the above copyright
204 notice appear in all copies and that both that copyright notice and this
205 permission notice appear in supporting documentation.  No representations are
206 made about the suitability of this software for any purpose.  It is provided
207 "as is" without express or implied warranty.
208 .SH AUTHOR
209 Jamie Zawinski <jwz@jwz.org>, 13-aug-92.
210
211 Viscosity support by Philip Edward Cutone, III.
212
213 Walls, speed limit options, new bouncing, graphs, and tail mode fix by
214 Matthew Strait. 31 March 2001