ftp://ftp.smr.ru/pub/0/FreeBSD/releases/distfiles/xscreensaver-3.16.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] [\-background \fIcolor\fP] [\-window] [\-root] [\-mono] [\-install] [\-visual \fIvisual\fP] [\-points \fIint\fP] [\-threshold \fIint\fP] [\-mode balls | lines | polygons | splines | filled-splines | tails ] [\-size \fIint\fP] [\-segments \fIint\fP] [\-delay \fIusecs\fP] [\-color-shift \fIint\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 \-size integer
75 The size of the balls in pixels, or 0, meaning to select the sizes 
76 randomly (the default.)  If this is specified, then all balls will be 
77 the same size.  This option has an effect in all modes, since the ``size''
78 of the balls controls their mass.
79 .TP 8
80 .B \-segments integer
81 If in \fIlines\fP or \fIpolygons\fP mode, how many sets of line segments
82 or polygons should be drawn. Default 100.  This has no effect in \fIballs\fP
83 mode.  If \fIsegments\fP is 0, then no segments will ever be erased (this
84 is only useful in color.)
85 .TP 8
86 .B \-delay microseconds
87 How much of a delay should be introduced between steps of the animation.
88 Default 10000, or about 0.01 seconds.
89 .TP 8
90 .B \-color-shift int
91 If on a color display, the color of the line segments or polygons will 
92 cycle through the color map.  This specifies how many lines will be drawn
93 before a new color is chosen.  (When a small number of colors are available,
94 increasing this value will yield smoother transitions.)  Default 3.
95 This has no effect in \fIballs\fP mode.
96 .TP 8
97 .B \-radius
98 The size in pixels of the circle on which the points are initially positioned.
99 The default is slightly smaller than the size of the window.
100 .TP 8
101 .B \-glow
102 This is consulted only in \fIballs\fP mode.  If this is specified, then 
103 the saturation of the colors of the points will vary according to their
104 current acceleration.  This has the effect that the balls flare brighter
105 when they are reacting to each other most strongly.
106
107 In \fIglow\fP mode, all of the balls will be drawn the same (random)
108 color, modulo the saturation shifts.  In non-glow mode, the balls will
109 each be drawn in a random color that doesn't change.
110 .TP 8
111 .B \-noglow
112 Don't do ``glowing.''  This is the default.
113 .TP 8
114 .B \-vx pixels
115 .TP 8
116 .B \-vy pixels
117 Initial velocity of the balls.  This has no effect in \fB\-orbit\fP mode.
118 .TP 8
119 .B \-orbit
120 Make the initial force on each ball be tangential to the circle on which
121 they are initially placed, with the right velocity to hold them in orbit
122 about each other.  After a while, roundoff errors will cause the orbit
123 to decay.
124 .TP 8
125 .B \-vmult float
126 In orbit mode, the initial velocity of the balls is multiplied by this;
127 a number less than 1 will make the balls pull closer together, and a larger
128 number will make them move apart.  The default is 0.9, meaning a slight
129 inward pull.
130 .TP 8
131 .B \-viscosity float
132 This sets the viscosity of the hypothetical fluid through which the control
133 points move; the default is 1, meaning no resistance.  Values higher than 1
134 aren't interesting; lower values cause less motion.
135
136 One interesting thing to try is
137 .EX
138 attraction -viscosity 0.8 -points 75 \\
139   -mouse -geometry =500x500
140 .EE
141 Give it a few seconds to settle down into a stable clump, and then move
142 the mouse through it to make "waves".
143 .TP 8
144 .B \-mouse
145 This will cause the mouse to be considered a control point; it will not be
146 drawn, but it will influence the other points, so you can wave the mouse
147 and influence the images being created.
148 .TP 8
149 .B \-no-mouse
150 Turns off \fB\-mouse\fP.
151 .TP 8
152 .B \-mouse-size integer
153 In \fB\-mouse\fP mode, this sets the mass of the mouse (analagously to the
154 \fB\-size\fP parameter.)
155 .SH ENVIRONMENT
156 .PP
157 .TP 8
158 .B DISPLAY
159 to get the default host and display number.
160 .TP 8
161 .B XENVIRONMENT
162 to get the name of a resource file that overrides the global resources
163 stored in the RESOURCE_MANAGER property.
164 .SH SEE ALSO
165 .BR X (1),
166 .BR xscreensaver (1)
167 .SH COPYRIGHT
168 Copyright \(co 1992, 1993, 1997 by Jamie Zawinski.  Permission to use, copy,
169 modify, distribute, and sell this software and its documentation for any
170 purpose is hereby granted without fee, provided that the above copyright
171 notice appear in all copies and that both that copyright notice and this
172 permission notice appear in supporting documentation.  No representations are
173 made about the suitability of this software for any purpose.  It is provided
174 "as is" without express or implied warranty.
175 .SH AUTHOR
176 Jamie Zawinski <jwz@jwz.org>, 13-aug-92.
177
178 Viscosity and mouse support by Philip Edward Cutone, III.