http://www.ibiblio.org/pub/historic-linux/ftp-archives/sunsite.unc.edu/Sep-29-1996...
[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-Dec-95" "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] [\-background \fIcolor\fP] [\-window] [\-root] [\-mono] [\-install] [\-visual \fIvisual\fP] [\-points \fIint\fP] [\-threshold \fIint\fP] [\-mode balls | lines | polygons | splines | filled-splines | tails ] [\-color-mode cycle | random] [\-size \fIint\fP] [\-segments \fIint\fP] [\-delay \fIusecs\fP] [\-color-shift \fIdegrees\fP] [\-radius \fIint\fP] [\-vx \fIint\fP] [\-vy \fIint\fP] [\-glow] [\-noglow] [\-orbit] [\-viscosity \fIfloat\fP] [\-mouse] [\-no-mouse] [\-mouse-size]
20 .SH DESCRIPTION
21 The \fIattraction\fP program has several visually different modes of 
22 operation, all of which are based on the interactions of a set of control
23 points which attract each other up to a certain distance, and then begin
24 to repel each other.  The attraction/repulsion is proportional to the 
25 distance between any two particles.
26 .SH OPTIONS
27 .I attraction
28 accepts the following options:
29 .TP 8
30 .B \-window
31 Draw on a newly-created window.  This is the default.
32 .TP 8
33 .B \-root
34 Draw on the root window.
35 .TP 8
36 .B \-mono 
37 If on a color display, pretend we're on a monochrome display.
38 .TP 8
39 .B \-install
40 Install a private colormap for the window.
41 .TP 8
42 .B \-visual \fIvisual\fP
43 Specify which visual to use.  Legal values are the name of a visual class,
44 or the id number (decimal or hex) of a specific visual.
45 .TP 8
46 .B \-points integer
47 How many control points should be used, or 0 to select the number randomly.
48 Default 0.  Between 3 and 15 works best.
49 .TP 8
50 .B \-threshold integer
51 The distance (in pixels) from each particle at which the attractive force
52 becomes repulsive.  Default 100.
53 .TP 8
54 .B \-mode "balls | lines | polygons | tails | splines | filled-splines"
55 In \fIballs\fP mode (the default) the control points are drawn as filled
56 circles.  The larger the circle, the more massive the particle.
57
58 In \fIlines\fP mode, the control points are connected by straight lines;
59 the effect is something like \fIqix\fP.
60
61 In \fIpolygons\fP mode, the control points are connected by straight
62 lines, and filled in.  This is most interesting in color.
63
64 In \fIsplines\fP mode, a closed spline is interpolated from the control 
65 points.
66
67 In \fIfilled-splines\fP mode, the splines are filled in instead of being
68 outlines.  This is most interesting in color.
69
70 In \fItails\fP mode, the path which each particle follows is indicated
71 by a worm-like trail, whose length is controlled by the \fIsegments\fP
72 parameter.
73 .TP 8
74 .B \-color-mode cycle | random
75 Whether colors should cycle through the spectrum, or be picked randomly.
76 .TP 8
77 .B \-size integer
78 The size of the balls in pixels, or 0, meaning to select the sizes 
79 randomly (the default.)  If this is specified, then all balls will be 
80 the same size.  This option has an effect in all modes, since the ``size''
81 of the balls controls their mass.
82 .TP 8
83 .B \-segments integer
84 If in \fIlines\fP or \fIpolygons\fP mode, how many sets of line segments
85 or polygons should be drawn. Default 100.  This has no effect in \fIballs\fP
86 mode.  If \fIsegments\fP is 0, then no segments will ever be erased (this
87 is only useful in color.)
88 .TP 8
89 .B \-delay microseconds
90 How much of a delay should be introduced between steps of the animation.
91 Default 10000, or about 0.01 seconds.
92 .TP 8
93 .B \-color-shift degrees
94 If on a color display, the color of the line segments or polygons will 
95 cycle through the spectrum.  This specifies how far the hue of each segment
96 should be from the next, in degrees on the HSV wheel.  Default 3.
97 This has no effect in \fIballs\fP mode.
98 .TP 8
99 .B \-radius
100 The size in pixels of the circle on which the points are initially positioned.
101 The default is slightly smaller than the size of the window.
102 .TP 8
103 .B \-glow
104 This is consulted only in \fIballs\fP mode.  If this is specified, then 
105 the saturation of the colors of the points will vary according to their
106 current acceleration.  This has the effect that the balls flare brighter
107 when they are reacting to each other most strongly.
108
109 In \fIglow\fP mode, all of the balls will be drawn the same (random)
110 color, modulo the saturation shifts.  In non-glow mode, the balls will
111 each be drawn in a random color that doesn't change.
112 .TP 8
113 .B \-noglow
114 Don't do ``glowing.''  This is the default.
115 .TP 8
116 .B \-vx pixels
117 .TP 8
118 .B \-vy pixels
119 Initial velocity of the balls.  This has no effect in \fB\-orbit\fP mode.
120 .TP 8
121 .B \-orbit
122 Make the initial force on each ball be tangential to the circle on which
123 they are initially placed, with the right velocity to hold them in orbit
124 about each other.  After a while, roundoff errors will cause the orbit
125 to decay.
126 .TP 8
127 .B \-vmult float
128 In orbit mode, the initial velocity of the balls is multiplied by this;
129 a number less than 1 will make the balls pull closer together, and a larger
130 number will make them move apart.  The default is 1, meaning stability.
131 .TP 8
132 .B \-viscosity float
133 This sets the viscosity of the hypothetical fluid through which the control
134 points move; the default is 1, meaning no resistance.  Values higher than 1
135 aren't interesting; lower values cause less motion.
136
137 One interesting thing to try is
138 .EX
139 attraction -viscosity 0.8 -points 75 \\
140   -mouse -geometry =500x500
141 .EE
142 Give it a few seconds to settle down into a stable clump, and then move
143 the mouse through it to make "waves".
144 .TP 8
145 .B \-mouse
146 This will cause the mouse to be considered a control point; it will not be
147 drawn, but it will influence the other points, so you can wave the mouse
148 and influence the images being created.
149 .TP 8
150 .B \-no-mouse
151 Turns off \fB\-mouse\fP.
152 .TP 8
153 .B \-mouse-size integer
154 In \fB\-mouse\fP mode, this sets the mass of the mouse (analagously to the
155 \fB\-size\fP parameter.)
156 .SH ENVIRONMENT
157 .PP
158 .TP 8
159 .B DISPLAY
160 to get the default host and display number.
161 .TP 8
162 .B XENVIRONMENT
163 to get the name of a resource file that overrides the global resources
164 stored in the RESOURCE_MANAGER property.
165 .SH SEE ALSO
166 .BR X (1),
167 .BR xscreensaver (1)
168 .SH COPYRIGHT
169 Copyright \(co 1992, 1993 by Jamie Zawinski.  Permission to use, copy, modify, 
170 distribute, and sell this software and its documentation for any purpose is 
171 hereby granted without fee, provided that the above copyright notice appear 
172 in all copies and that both that copyright notice and this permission notice
173 appear in supporting documentation.  No representations are made about the 
174 suitability of this software for any purpose.  It is provided "as is" without
175 express or implied warranty.
176 .SH AUTHOR
177 Jamie Zawinski <jwz@netscape.com>, 13-aug-92.
178
179 Viscosity and mouse support by Philip Edward Cutone, III.