http://ftp.aanet.ru/pub/Linux/X11/apps/xscreensaver-2.31.tar.gz
[xscreensaver] / hacks / glx / shark.c
1 /* atlantis --- Shows moving 3D sea animals */
2
3 #if !defined( lint ) && !defined( SABER )
4 static const char sccsid[] = "@(#)shark.c       1.2 98/06/16 xlockmore";
5
6 #endif
7
8 /* Copyright (c) E. Lassauge, 1998. */
9
10 /*
11  * Permission to use, copy, modify, and distribute this software and its
12  * documentation for any purpose and without fee is hereby granted,
13  * provided that the above copyright notice appear in all copies and that
14  * both that copyright notice and this permission notice appear in
15  * supporting documentation.
16  *
17  * This file is provided AS IS with no warranties of any kind.  The author
18  * shall have no liability with respect to the infringement of copyrights,
19  * trade secrets or any patents by this file or any part thereof.  In no
20  * event will the author be liable for any lost revenue or profits or
21  * other special, indirect and consequential damages.
22  *
23  * The original code for this mode was written by Mark J. Kilgard
24  * as a demo for openGL programming.
25  * 
26  * Porting it to xlock  was possible by comparing the original Mesa's morph3d 
27  * demo with it's ported version to xlock, so thanks for Marcelo F. Vianna 
28  * (look at morph3d.c) for his indirect help.
29  *
30  * Thanks goes also to Brian Paul for making it possible and inexpensive
31  * to use OpenGL at home.
32  *
33  * My e-mail address is lassauge@sagem.fr
34  *
35  * Eric Lassauge  (May-13-1998)
36  *
37  */
38
39 /**
40  * (c) Copyright 1993, 1994, Silicon Graphics, Inc.
41  * ALL RIGHTS RESERVED
42  * Permission to use, copy, modify, and distribute this software for
43  * any purpose and without fee is hereby granted, provided that the above
44  * copyright notice appear in all copies and that both the copyright notice
45  * and this permission notice appear in supporting documentation, and that
46  * the name of Silicon Graphics, Inc. not be used in advertising
47  * or publicity pertaining to distribution of the software without specific,
48  * written prior permission.
49  *
50  * THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS"
51  * AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE,
52  * INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR
53  * FITNESS FOR A PARTICULAR PURPOSE.  IN NO EVENT SHALL SILICON
54  * GRAPHICS, INC.  BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT,
55  * SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY
56  * KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION,
57  * LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF
58  * THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC.  HAS BEEN
59  * ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON
60  * ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE
61  * POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE.
62  *
63  * US Government Users Restricted Rights
64  * Use, duplication, or disclosure by the Government is subject to
65  * restrictions set forth in FAR 52.227.19(c)(2) or subparagraph
66  * (c)(1)(ii) of the Rights in Technical Data and Computer Software
67  * clause at DFARS 252.227-7013 and/or in similar or successor
68  * clauses in the FAR or the DOD or NASA FAR Supplement.
69  * Unpublished-- rights reserved under the copyright laws of the
70  * United States.  Contractor/manufacturer is Silicon Graphics,
71  * Inc., 2011 N.  Shoreline Blvd., Mountain View, CA 94039-7311.
72  *
73  * OpenGL(TM) is a trademark of Silicon Graphics, Inc.
74  */
75
76 #ifndef STANDALONE
77 #include "xlock.h"
78 #endif
79
80 #ifdef USE_GL
81
82 #ifdef STANDALONE
83 #include <math.h>
84 #include <GL/glx.h>
85 #endif
86
87 #include "atlantis.h"
88 /* *INDENT-OFF* */
89 #if 0
90 static float N001[3] = {0.000000 ,1.000000 ,0.000000};
91 #endif
92 static float N002[3] = {0.000077 ,-0.020611 ,0.999788};
93 static float N003[3] = {0.961425 ,0.258729 ,-0.093390};
94 static float N004[3] = {0.510811 ,-0.769633 ,-0.383063};
95 static float N005[3] = {0.400123 ,0.855734 ,-0.328055};
96 static float N006[3] = {-0.770715 ,0.610204 ,-0.183440};
97 static float N007[3] = {-0.915597 ,-0.373345 ,-0.149316};
98 static float N008[3] = {-0.972788 ,0.208921 ,-0.100179};
99 static float N009[3] = {-0.939713 ,-0.312268 ,-0.139383};
100 static float N010[3] = {-0.624138 ,-0.741047 ,-0.247589};
101 static float N011[3] = {0.591434 ,-0.768401 ,-0.244471};
102 static float N012[3] = {0.935152 ,-0.328495 ,-0.132598};
103 static float N013[3] = {0.997102 ,0.074243 ,-0.016593};
104 static float N014[3] = {0.969995 ,0.241712 ,-0.026186};
105 static float N015[3] = {0.844539 ,0.502628 ,-0.184714};
106 static float N016[3] = {-0.906608 ,0.386308 ,-0.169787};
107 static float N017[3] = {-0.970016 ,0.241698 ,-0.025516};
108 static float N018[3] = {-0.998652 ,0.050493 ,-0.012045};
109 static float N019[3] = {-0.942685 ,-0.333051 ,-0.020556};
110 static float N020[3] = {-0.660944 ,-0.750276 ,0.015480};
111 static float N021[3] = {0.503549 ,-0.862908 ,-0.042749};
112 static float N022[3] = {0.953202 ,-0.302092 ,-0.012089};
113 static float N023[3] = {0.998738 ,0.023574 ,0.044344};
114 static float N024[3] = {0.979297 ,0.193272 ,0.060202};
115 static float N025[3] = {0.798300 ,0.464885 ,0.382883};
116 static float N026[3] = {-0.756590 ,0.452403 ,0.472126};
117 static float N027[3] = {-0.953855 ,0.293003 ,0.065651};
118 static float N028[3] = {-0.998033 ,0.040292 ,0.048028};
119 static float N029[3] = {-0.977079 ,-0.204288 ,0.059858};
120 static float N030[3] = {-0.729117 ,-0.675304 ,0.111140};
121 static float N031[3] = {0.598361 ,-0.792753 ,0.116221};
122 static float N032[3] = {0.965192 ,-0.252991 ,0.066332};
123 static float N033[3] = {0.998201 ,-0.002790 ,0.059892};
124 static float N034[3] = {0.978657 ,0.193135 ,0.070207};
125 static float N035[3] = {0.718815 ,0.680392 ,0.142733};
126 static float N036[3] = {-0.383096 ,0.906212 ,0.178936};
127 static float N037[3] = {-0.952831 ,0.292590 ,0.080647};
128 static float N038[3] = {-0.997680 ,0.032417 ,0.059861};
129 static float N039[3] = {-0.982629 ,-0.169881 ,0.074700};
130 static float N040[3] = {-0.695424 ,-0.703466 ,0.146700};
131 static float N041[3] = {0.359323 ,-0.915531 ,0.180805};
132 static float N042[3] = {0.943356 ,-0.319387 ,0.089842};
133 static float N043[3] = {0.998272 ,-0.032435 ,0.048993};
134 static float N044[3] = {0.978997 ,0.193205 ,0.065084};
135 static float N045[3] = {0.872144 ,0.470094 ,-0.135565};
136 static float N046[3] = {-0.664282 ,0.737945 ,-0.119027};
137 static float N047[3] = {-0.954508 ,0.288570 ,0.075107};
138 static float N048[3] = {-0.998273 ,0.032406 ,0.048993};
139 static float N049[3] = {-0.979908 ,-0.193579 ,0.048038};
140 static float N050[3] = {-0.858736 ,-0.507202 ,-0.072938};
141 static float N051[3] = {0.643545 ,-0.763887 ,-0.048237};
142 static float N052[3] = {0.955580 ,-0.288954 ,0.058068};
143 #if 0
144 static float N053[3] = {0.000000 ,1.000000 ,0.000000};
145 static float N054[3] = {0.000000 ,1.000000 ,0.000000};
146 static float N055[3] = {0.000000 ,1.000000 ,0.000000};
147 static float N056[3] = {0.000000 ,1.000000 ,0.000000};
148 static float N057[3] = {0.000000 ,1.000000 ,0.000000};
149 #endif
150 static float N058[3] = {0.000050 ,0.793007 ,-0.609213};
151 static float N059[3] = {0.913510 ,0.235418 ,-0.331779};
152 static float N060[3] = {-0.807970 ,0.495000 ,-0.319625};
153 static float N061[3] = {0.000000 ,0.784687 ,-0.619892};
154 static float N062[3] = {0.000000 ,-1.000000 ,0.000000};
155 static float N063[3] = {0.000000 ,1.000000 ,0.000000};
156 static float N064[3] = {0.000000 ,1.000000 ,0.000000};
157 static float N065[3] = {0.000000 ,1.000000 ,0.000000};
158 static float N066[3] = {-0.055784 ,0.257059 ,0.964784};
159 #if 0
160 static float N067[3] = {0.000000 ,1.000000 ,0.000000};
161 static float N068[3] = {0.000000 ,1.000000 ,0.000000};
162 #endif
163 static float N069[3] = {-0.000505 ,-0.929775 ,-0.368127};
164 static float N070[3] = {0.000000 ,1.000000 ,0.000000};
165 #if 0
166 static float N071[3] = {-0.987102 ,0.131723 ,-0.090984};
167 static float N072[3] = {-0.987102 ,0.131723 ,-0.090984};
168 static float N073[3] = {-0.987102 ,0.131723 ,-0.090984};
169 static float N074[3] = {0.000000 ,1.000000 ,0.000000};
170 static float N075[3] = {0.000000 ,1.000000 ,0.000000};
171 static float N076[3] = {0.000000 ,1.000000 ,0.000000};
172 static float N077[3] = {0.995210 ,0.071962 ,-0.066168};
173 static float N078[3] = {0.995210 ,0.071962 ,-0.066168};
174 static float N079[3] = {0.995210 ,0.071962 ,-0.066168};
175 static float N080[3] = {0.000000 ,1.000000 ,0.000000};
176 static float N081[3] = {0.000000 ,1.000000 ,0.000000};
177 static float N082[3] = {0.000000 ,1.000000 ,0.000000};
178 static float P001[3] = {0.00, 0.00, 0.00};
179 #endif
180 static float P002[3] = {0.00, -36.59, 5687.72};
181 static float P003[3] = {90.00, 114.73, 724.38};
182 static float P004[3] = {58.24, -146.84, 262.35};
183 static float P005[3] = {27.81, 231.52, 510.43};
184 static float P006[3] = {-27.81, 230.43, 509.76};
185 static float P007[3] = {-46.09, -146.83, 265.84};
186 static float P008[3] = {-90.00, 103.84, 718.53};
187 static float P009[3] = {-131.10, -165.92, 834.85};
188 static float P010[3] = {-27.81, -285.31, 500.00};
189 static float P011[3] = {27.81, -285.32, 500.00};
190 static float P012[3] = {147.96, -170.89, 845.50};
191 static float P013[3] = {180.00, 0.00, 2000.00};
192 static float P014[3] = {145.62, 352.67, 2000.00};
193 static float P015[3] = {55.62, 570.63, 2000.00};
194 static float P016[3] = {-55.62, 570.64, 2000.00};
195 static float P017[3] = {-145.62, 352.68, 2000.00};
196 static float P018[3] = {-180.00, 0.01, 2000.00};
197 static float P019[3] = {-178.20, -352.66, 2001.61};
198 static float P020[3] = {-55.63, -570.63, 2000.00};
199 static float P021[3] = {55.62, -570.64, 2000.00};
200 static float P022[3] = {179.91, -352.69, 1998.39};
201 static float P023[3] = {150.00, 0.00, 3000.00};
202 static float P024[3] = {121.35, 293.89, 3000.00};
203 static float P025[3] = {46.35, 502.93, 2883.09};
204 static float P026[3] = {-46.35, 497.45, 2877.24};
205 static float P027[3] = {-121.35, 293.90, 3000.00};
206 static float P028[3] = {-150.00, 0.00, 3000.00};
207 static float P029[3] = {-152.21, -304.84, 2858.68};
208 static float P030[3] = {-46.36, -475.52, 3000.00};
209 static float P031[3] = {46.35, -475.53, 3000.00};
210 static float P032[3] = {155.64, -304.87, 2863.50};
211 static float P033[3] = {90.00, 0.00, 4000.00};
212 static float P034[3] = {72.81, 176.33, 4000.00};
213 static float P035[3] = {27.81, 285.32, 4000.00};
214 static float P036[3] = {-27.81, 285.32, 4000.00};
215 static float P037[3] = {-72.81, 176.34, 4000.00};
216 static float P038[3] = {-90.00, 0.00, 4000.00};
217 static float P039[3] = {-72.81, -176.33, 4000.00};
218 static float P040[3] = {-27.81, -285.31, 4000.00};
219 static float P041[3] = {27.81, -285.32, 4000.00};
220 static float P042[3] = {72.81, -176.34, 4000.00};
221 static float P043[3] = {30.00, 0.00, 5000.00};
222 static float P044[3] = {24.27, 58.78, 5000.00};
223 static float P045[3] = {9.27, 95.11, 5000.00};
224 static float P046[3] = {-9.27, 95.11, 5000.00};
225 static float P047[3] = {-24.27, 58.78, 5000.00};
226 static float P048[3] = {-30.00, 0.00, 5000.00};
227 static float P049[3] = {-24.27, -58.78, 5000.00};
228 static float P050[3] = {-9.27, -95.10, 5000.00};
229 static float P051[3] = {9.27, -95.11, 5000.00};
230 static float P052[3] = {24.27, -58.78, 5000.00};
231 #if 0
232 static float P053[3] = {0.00, 0.00, 0.00};
233 static float P054[3] = {0.00, 0.00, 0.00};
234 static float P055[3] = {0.00, 0.00, 0.00};
235 static float P056[3] = {0.00, 0.00, 0.00};
236 static float P057[3] = {0.00, 0.00, 0.00};
237 #endif
238 static float P058[3] = {0.00, 1212.72, 2703.08};
239 static float P059[3] = {50.36, 0.00, 108.14};
240 static float P060[3] = {-22.18, 0.00, 108.14};
241 static float P061[3] = {0.00, 1181.61, 6344.65};
242 static float P062[3] = {516.45, -887.08, 2535.45};
243 static float P063[3] = {-545.69, -879.31, 2555.63};
244 static float P064[3] = {618.89, -1005.64, 2988.32};
245 static float P065[3] = {-635.37, -1014.79, 2938.68};
246 static float P066[3] = {0.00, 1374.43, 3064.18};
247 #if 0
248 static float P067[3] = {158.49, -11.89, 1401.56};
249 static float P068[3] = {-132.08, -17.90, 1394.31};
250 #endif
251 static float P069[3] = {0.00, -418.25, 5765.04};
252 static float P070[3] = {0.00, 1266.91, 6629.60};
253 static float P071[3] = {-139.12, -124.96, 997.98};
254 static float P072[3] = {-139.24, -110.18, 1020.68};
255 static float P073[3] = {-137.33, -94.52, 1022.63};
256 static float P074[3] = {-137.03, -79.91, 996.89};
257 static float P075[3] = {-135.21, -91.48, 969.14};
258 static float P076[3] = {-135.39, -110.87, 968.76};
259 static float P077[3] = {150.23, -78.44, 995.53};
260 static float P078[3] = {152.79, -92.76, 1018.46};
261 static float P079[3] = {154.19, -110.20, 1020.55};
262 static float P080[3] = {151.33, -124.15, 993.77};
263 static float P081[3] = {150.49, -111.19, 969.86};
264 static float P082[3] = {150.79, -92.41, 969.70};
265 static float iP002[3] = {0.00, -36.59, 5687.72};
266 static float iP004[3] = {58.24, -146.84, 262.35};
267 static float iP007[3] = {-46.09, -146.83, 265.84};
268 static float iP010[3] = {-27.81, -285.31, 500.00};
269 static float iP011[3] = {27.81, -285.32, 500.00};
270 static float iP023[3] = {150.00, 0.00, 3000.00};
271 static float iP024[3] = {121.35, 293.89, 3000.00};
272 static float iP025[3] = {46.35, 502.93, 2883.09};
273 static float iP026[3] = {-46.35, 497.45, 2877.24};
274 static float iP027[3] = {-121.35, 293.90, 3000.00};
275 static float iP028[3] = {-150.00, 0.00, 3000.00};
276 static float iP029[3] = {-121.35, -304.84, 2853.86};
277 static float iP030[3] = {-46.36, -475.52, 3000.00};
278 static float iP031[3] = {46.35, -475.53, 3000.00};
279 static float iP032[3] = {121.35, -304.87, 2853.86};
280 static float iP033[3] = {90.00, 0.00, 4000.00};
281 static float iP034[3] = {72.81, 176.33, 4000.00};
282 static float iP035[3] = {27.81, 285.32, 4000.00};
283 static float iP036[3] = {-27.81, 285.32, 4000.00};
284 static float iP037[3] = {-72.81, 176.34, 4000.00};
285 static float iP038[3] = {-90.00, 0.00, 4000.00};
286 static float iP039[3] = {-72.81, -176.33, 4000.00};
287 static float iP040[3] = {-27.81, -285.31, 4000.00};
288 static float iP041[3] = {27.81, -285.32, 4000.00};
289 static float iP042[3] = {72.81, -176.34, 4000.00};
290 static float iP043[3] = {30.00, 0.00, 5000.00};
291 static float iP044[3] = {24.27, 58.78, 5000.00};
292 static float iP045[3] = {9.27, 95.11, 5000.00};
293 static float iP046[3] = {-9.27, 95.11, 5000.00};
294 static float iP047[3] = {-24.27, 58.78, 5000.00};
295 static float iP048[3] = {-30.00, 0.00, 5000.00};
296 static float iP049[3] = {-24.27, -58.78, 5000.00};
297 static float iP050[3] = {-9.27, -95.10, 5000.00};
298 static float iP051[3] = {9.27, -95.11, 5000.00};
299 static float iP052[3] = {24.27, -58.78, 5000.00};
300 #if 0
301 static float iP053[3] = {0.00, 0.00, 0.00};
302 #endif
303 static float iP061[3] = {0.00, 1181.61, 6344.65};
304 static float iP069[3] = {0.00, -418.25, 5765.04};
305 static float iP070[3] = {0.00, 1266.91, 6629.60};
306 /* *INDENT-ON* */
307
308
309
310 static void
311 Fish001(GLenum cap)
312 {
313         glBegin(cap);
314         glNormal3fv(N005);
315         glVertex3fv(P005);
316         glNormal3fv(N059);
317         glVertex3fv(P059);
318         glNormal3fv(N060);
319         glVertex3fv(P060);
320         glNormal3fv(N006);
321         glVertex3fv(P006);
322         glEnd();
323         glBegin(cap);
324         glNormal3fv(N015);
325         glVertex3fv(P015);
326         glNormal3fv(N005);
327         glVertex3fv(P005);
328         glNormal3fv(N006);
329         glVertex3fv(P006);
330         glNormal3fv(N016);
331         glVertex3fv(P016);
332         glEnd();
333         glBegin(cap);
334         glNormal3fv(N006);
335         glVertex3fv(P006);
336         glNormal3fv(N060);
337         glVertex3fv(P060);
338         glNormal3fv(N008);
339         glVertex3fv(P008);
340         glEnd();
341         glBegin(cap);
342         glNormal3fv(N016);
343         glVertex3fv(P016);
344         glNormal3fv(N006);
345         glVertex3fv(P006);
346         glNormal3fv(N008);
347         glVertex3fv(P008);
348         glEnd();
349         glBegin(cap);
350         glNormal3fv(N016);
351         glVertex3fv(P016);
352         glNormal3fv(N008);
353         glVertex3fv(P008);
354         glNormal3fv(N017);
355         glVertex3fv(P017);
356         glEnd();
357         glBegin(cap);
358         glNormal3fv(N017);
359         glVertex3fv(P017);
360         glNormal3fv(N008);
361         glVertex3fv(P008);
362         glNormal3fv(N018);
363         glVertex3fv(P018);
364         glEnd();
365         glBegin(cap);
366         glNormal3fv(N008);
367         glVertex3fv(P008);
368         glNormal3fv(N009);
369         glVertex3fv(P009);
370         glNormal3fv(N018);
371         glVertex3fv(P018);
372         glEnd();
373         glBegin(cap);
374         glNormal3fv(N008);
375         glVertex3fv(P008);
376         glNormal3fv(N060);
377         glVertex3fv(P060);
378         glNormal3fv(N009);
379         glVertex3fv(P009);
380         glEnd();
381         glBegin(cap);
382         glNormal3fv(N007);
383         glVertex3fv(P007);
384         glNormal3fv(N010);
385         glVertex3fv(P010);
386         glNormal3fv(N009);
387         glVertex3fv(P009);
388         glEnd();
389         glBegin(cap);
390         glNormal3fv(N009);
391         glVertex3fv(P009);
392         glNormal3fv(N019);
393         glVertex3fv(P019);
394         glNormal3fv(N018);
395         glVertex3fv(P018);
396         glEnd();
397         glBegin(cap);
398         glNormal3fv(N009);
399         glVertex3fv(P009);
400         glNormal3fv(N010);
401         glVertex3fv(P010);
402         glNormal3fv(N019);
403         glVertex3fv(P019);
404         glEnd();
405         glBegin(cap);
406         glNormal3fv(N010);
407         glVertex3fv(P010);
408         glNormal3fv(N020);
409         glVertex3fv(P020);
410         glNormal3fv(N019);
411         glVertex3fv(P019);
412         glEnd();
413         glBegin(cap);
414         glNormal3fv(N010);
415         glVertex3fv(P010);
416         glNormal3fv(N011);
417         glVertex3fv(P011);
418         glNormal3fv(N021);
419         glVertex3fv(P021);
420         glNormal3fv(N020);
421         glVertex3fv(P020);
422         glEnd();
423         glBegin(cap);
424         glNormal3fv(N004);
425         glVertex3fv(P004);
426         glNormal3fv(N011);
427         glVertex3fv(P011);
428         glNormal3fv(N010);
429         glVertex3fv(P010);
430         glNormal3fv(N007);
431         glVertex3fv(P007);
432         glEnd();
433         glBegin(cap);
434         glNormal3fv(N004);
435         glVertex3fv(P004);
436         glNormal3fv(N012);
437         glVertex3fv(P012);
438         glNormal3fv(N011);
439         glVertex3fv(P011);
440         glEnd();
441         glBegin(cap);
442         glNormal3fv(N012);
443         glVertex3fv(P012);
444         glNormal3fv(N022);
445         glVertex3fv(P022);
446         glNormal3fv(N011);
447         glVertex3fv(P011);
448         glEnd();
449         glBegin(cap);
450         glNormal3fv(N011);
451         glVertex3fv(P011);
452         glNormal3fv(N022);
453         glVertex3fv(P022);
454         glNormal3fv(N021);
455         glVertex3fv(P021);
456         glEnd();
457         glBegin(cap);
458         glNormal3fv(N059);
459         glVertex3fv(P059);
460         glNormal3fv(N005);
461         glVertex3fv(P005);
462         glNormal3fv(N015);
463         glVertex3fv(P015);
464         glEnd();
465         glBegin(cap);
466         glNormal3fv(N015);
467         glVertex3fv(P015);
468         glNormal3fv(N014);
469         glVertex3fv(P014);
470         glNormal3fv(N003);
471         glVertex3fv(P003);
472         glEnd();
473         glBegin(cap);
474         glNormal3fv(N015);
475         glVertex3fv(P015);
476         glNormal3fv(N003);
477         glVertex3fv(P003);
478         glNormal3fv(N059);
479         glVertex3fv(P059);
480         glEnd();
481         glBegin(cap);
482         glNormal3fv(N014);
483         glVertex3fv(P014);
484         glNormal3fv(N013);
485         glVertex3fv(P013);
486         glNormal3fv(N003);
487         glVertex3fv(P003);
488         glEnd();
489         glBegin(cap);
490         glNormal3fv(N003);
491         glVertex3fv(P003);
492         glNormal3fv(N012);
493         glVertex3fv(P012);
494         glNormal3fv(N059);
495         glVertex3fv(P059);
496         glEnd();
497         glBegin(cap);
498         glNormal3fv(N013);
499         glVertex3fv(P013);
500         glNormal3fv(N012);
501         glVertex3fv(P012);
502         glNormal3fv(N003);
503         glVertex3fv(P003);
504         glEnd();
505         glBegin(cap);
506         glNormal3fv(N013);
507         glVertex3fv(P013);
508         glNormal3fv(N022);
509         glVertex3fv(P022);
510         glNormal3fv(N012);
511         glVertex3fv(P012);
512         glEnd();
513         glBegin(cap);
514         glVertex3fv(P071);
515         glVertex3fv(P072);
516         glVertex3fv(P073);
517         glVertex3fv(P074);
518         glVertex3fv(P075);
519         glVertex3fv(P076);
520         glEnd();
521         glBegin(cap);
522         glVertex3fv(P077);
523         glVertex3fv(P078);
524         glVertex3fv(P079);
525         glVertex3fv(P080);
526         glVertex3fv(P081);
527         glVertex3fv(P082);
528         glEnd();
529 }
530
531 static void
532 Fish002(GLenum cap)
533 {
534         glBegin(cap);
535         glNormal3fv(N013);
536         glVertex3fv(P013);
537         glNormal3fv(N014);
538         glVertex3fv(P014);
539         glNormal3fv(N024);
540         glVertex3fv(P024);
541         glNormal3fv(N023);
542         glVertex3fv(P023);
543         glEnd();
544         glBegin(cap);
545         glNormal3fv(N014);
546         glVertex3fv(P014);
547         glNormal3fv(N015);
548         glVertex3fv(P015);
549         glNormal3fv(N025);
550         glVertex3fv(P025);
551         glNormal3fv(N024);
552         glVertex3fv(P024);
553         glEnd();
554         glBegin(cap);
555         glNormal3fv(N016);
556         glVertex3fv(P016);
557         glNormal3fv(N017);
558         glVertex3fv(P017);
559         glNormal3fv(N027);
560         glVertex3fv(P027);
561         glNormal3fv(N026);
562         glVertex3fv(P026);
563         glEnd();
564         glBegin(cap);
565         glNormal3fv(N017);
566         glVertex3fv(P017);
567         glNormal3fv(N018);
568         glVertex3fv(P018);
569         glNormal3fv(N028);
570         glVertex3fv(P028);
571         glNormal3fv(N027);
572         glVertex3fv(P027);
573         glEnd();
574         glBegin(cap);
575         glNormal3fv(N020);
576         glVertex3fv(P020);
577         glNormal3fv(N021);
578         glVertex3fv(P021);
579         glNormal3fv(N031);
580         glVertex3fv(P031);
581         glNormal3fv(N030);
582         glVertex3fv(P030);
583         glEnd();
584         glBegin(cap);
585         glNormal3fv(N013);
586         glVertex3fv(P013);
587         glNormal3fv(N023);
588         glVertex3fv(P023);
589         glNormal3fv(N022);
590         glVertex3fv(P022);
591         glEnd();
592         glBegin(cap);
593         glNormal3fv(N022);
594         glVertex3fv(P022);
595         glNormal3fv(N023);
596         glVertex3fv(P023);
597         glNormal3fv(N032);
598         glVertex3fv(P032);
599         glEnd();
600         glBegin(cap);
601         glNormal3fv(N022);
602         glVertex3fv(P022);
603         glNormal3fv(N032);
604         glVertex3fv(P032);
605         glNormal3fv(N031);
606         glVertex3fv(P031);
607         glEnd();
608         glBegin(cap);
609         glNormal3fv(N022);
610         glVertex3fv(P022);
611         glNormal3fv(N031);
612         glVertex3fv(P031);
613         glNormal3fv(N021);
614         glVertex3fv(P021);
615         glEnd();
616         glBegin(cap);
617         glNormal3fv(N018);
618         glVertex3fv(P018);
619         glNormal3fv(N019);
620         glVertex3fv(P019);
621         glNormal3fv(N029);
622         glVertex3fv(P029);
623         glEnd();
624         glBegin(cap);
625         glNormal3fv(N018);
626         glVertex3fv(P018);
627         glNormal3fv(N029);
628         glVertex3fv(P029);
629         glNormal3fv(N028);
630         glVertex3fv(P028);
631         glEnd();
632         glBegin(cap);
633         glNormal3fv(N019);
634         glVertex3fv(P019);
635         glNormal3fv(N020);
636         glVertex3fv(P020);
637         glNormal3fv(N030);
638         glVertex3fv(P030);
639         glEnd();
640         glBegin(cap);
641         glNormal3fv(N019);
642         glVertex3fv(P019);
643         glNormal3fv(N030);
644         glVertex3fv(P030);
645         glNormal3fv(N029);
646         glVertex3fv(P029);
647         glEnd();
648 }
649
650 static void
651 Fish003(GLenum cap)
652 {
653         glBegin(cap);
654         glNormal3fv(N032);
655         glVertex3fv(P032);
656         glNormal3fv(N023);
657         glVertex3fv(P023);
658         glNormal3fv(N033);
659         glVertex3fv(P033);
660         glNormal3fv(N042);
661         glVertex3fv(P042);
662         glEnd();
663         glBegin(cap);
664         glNormal3fv(N031);
665         glVertex3fv(P031);
666         glNormal3fv(N032);
667         glVertex3fv(P032);
668         glNormal3fv(N042);
669         glVertex3fv(P042);
670         glNormal3fv(N041);
671         glVertex3fv(P041);
672         glEnd();
673         glBegin(cap);
674         glNormal3fv(N023);
675         glVertex3fv(P023);
676         glNormal3fv(N024);
677         glVertex3fv(P024);
678         glNormal3fv(N034);
679         glVertex3fv(P034);
680         glNormal3fv(N033);
681         glVertex3fv(P033);
682         glEnd();
683         glBegin(cap);
684         glNormal3fv(N024);
685         glVertex3fv(P024);
686         glNormal3fv(N025);
687         glVertex3fv(P025);
688         glNormal3fv(N035);
689         glVertex3fv(P035);
690         glNormal3fv(N034);
691         glVertex3fv(P034);
692         glEnd();
693         glBegin(cap);
694         glNormal3fv(N030);
695         glVertex3fv(P030);
696         glNormal3fv(N031);
697         glVertex3fv(P031);
698         glNormal3fv(N041);
699         glVertex3fv(P041);
700         glNormal3fv(N040);
701         glVertex3fv(P040);
702         glEnd();
703         glBegin(cap);
704         glNormal3fv(N025);
705         glVertex3fv(P025);
706         glNormal3fv(N026);
707         glVertex3fv(P026);
708         glNormal3fv(N036);
709         glVertex3fv(P036);
710         glNormal3fv(N035);
711         glVertex3fv(P035);
712         glEnd();
713         glBegin(cap);
714         glNormal3fv(N026);
715         glVertex3fv(P026);
716         glNormal3fv(N027);
717         glVertex3fv(P027);
718         glNormal3fv(N037);
719         glVertex3fv(P037);
720         glNormal3fv(N036);
721         glVertex3fv(P036);
722         glEnd();
723         glBegin(cap);
724         glNormal3fv(N027);
725         glVertex3fv(P027);
726         glNormal3fv(N028);
727         glVertex3fv(P028);
728         glNormal3fv(N038);
729         glVertex3fv(P038);
730         glNormal3fv(N037);
731         glVertex3fv(P037);
732         glEnd();
733         glBegin(cap);
734         glNormal3fv(N028);
735         glVertex3fv(P028);
736         glNormal3fv(N029);
737         glVertex3fv(P029);
738         glNormal3fv(N039);
739         glVertex3fv(P039);
740         glNormal3fv(N038);
741         glVertex3fv(P038);
742         glEnd();
743         glBegin(cap);
744         glNormal3fv(N029);
745         glVertex3fv(P029);
746         glNormal3fv(N030);
747         glVertex3fv(P030);
748         glNormal3fv(N040);
749         glVertex3fv(P040);
750         glNormal3fv(N039);
751         glVertex3fv(P039);
752         glEnd();
753 }
754
755 static void
756 Fish004(GLenum cap)
757 {
758         glBegin(cap);
759         glNormal3fv(N040);
760         glVertex3fv(P040);
761         glNormal3fv(N041);
762         glVertex3fv(P041);
763         glNormal3fv(N051);
764         glVertex3fv(P051);
765         glNormal3fv(N050);
766         glVertex3fv(P050);
767         glEnd();
768         glBegin(cap);
769         glNormal3fv(N041);
770         glVertex3fv(P041);
771         glNormal3fv(N042);
772         glVertex3fv(P042);
773         glNormal3fv(N052);
774         glVertex3fv(P052);
775         glNormal3fv(N051);
776         glVertex3fv(P051);
777         glEnd();
778         glBegin(cap);
779         glNormal3fv(N042);
780         glVertex3fv(P042);
781         glNormal3fv(N033);
782         glVertex3fv(P033);
783         glNormal3fv(N043);
784         glVertex3fv(P043);
785         glNormal3fv(N052);
786         glVertex3fv(P052);
787         glEnd();
788         glBegin(cap);
789         glNormal3fv(N033);
790         glVertex3fv(P033);
791         glNormal3fv(N034);
792         glVertex3fv(P034);
793         glNormal3fv(N044);
794         glVertex3fv(P044);
795         glNormal3fv(N043);
796         glVertex3fv(P043);
797         glEnd();
798         glBegin(cap);
799         glNormal3fv(N034);
800         glVertex3fv(P034);
801         glNormal3fv(N035);
802         glVertex3fv(P035);
803         glNormal3fv(N045);
804         glVertex3fv(P045);
805         glNormal3fv(N044);
806         glVertex3fv(P044);
807         glEnd();
808         glBegin(cap);
809         glNormal3fv(N035);
810         glVertex3fv(P035);
811         glNormal3fv(N036);
812         glVertex3fv(P036);
813         glNormal3fv(N046);
814         glVertex3fv(P046);
815         glNormal3fv(N045);
816         glVertex3fv(P045);
817         glEnd();
818         glBegin(cap);
819         glNormal3fv(N036);
820         glVertex3fv(P036);
821         glNormal3fv(N037);
822         glVertex3fv(P037);
823         glNormal3fv(N047);
824         glVertex3fv(P047);
825         glNormal3fv(N046);
826         glVertex3fv(P046);
827         glEnd();
828         glBegin(cap);
829         glNormal3fv(N037);
830         glVertex3fv(P037);
831         glNormal3fv(N038);
832         glVertex3fv(P038);
833         glNormal3fv(N048);
834         glVertex3fv(P048);
835         glNormal3fv(N047);
836         glVertex3fv(P047);
837         glEnd();
838         glBegin(cap);
839         glNormal3fv(N038);
840         glVertex3fv(P038);
841         glNormal3fv(N039);
842         glVertex3fv(P039);
843         glNormal3fv(N049);
844         glVertex3fv(P049);
845         glNormal3fv(N048);
846         glVertex3fv(P048);
847         glEnd();
848         glBegin(cap);
849         glNormal3fv(N039);
850         glVertex3fv(P039);
851         glNormal3fv(N040);
852         glVertex3fv(P040);
853         glNormal3fv(N050);
854         glVertex3fv(P050);
855         glNormal3fv(N049);
856         glVertex3fv(P049);
857         glEnd();
858         glBegin(cap);
859         glNormal3fv(N070);
860         glVertex3fv(P070);
861         glNormal3fv(N061);
862         glVertex3fv(P061);
863         glNormal3fv(N002);
864         glVertex3fv(P002);
865         glEnd();
866         glBegin(cap);
867         glNormal3fv(N061);
868         glVertex3fv(P061);
869         glNormal3fv(N046);
870         glVertex3fv(P046);
871         glNormal3fv(N002);
872         glVertex3fv(P002);
873         glEnd();
874         glBegin(cap);
875         glNormal3fv(N045);
876         glVertex3fv(P045);
877         glNormal3fv(N046);
878         glVertex3fv(P046);
879         glNormal3fv(N061);
880         glVertex3fv(P061);
881         glEnd();
882         glBegin(cap);
883         glNormal3fv(N002);
884         glVertex3fv(P002);
885         glNormal3fv(N061);
886         glVertex3fv(P061);
887         glNormal3fv(N070);
888         glVertex3fv(P070);
889         glEnd();
890         glBegin(cap);
891         glNormal3fv(N002);
892         glVertex3fv(P002);
893         glNormal3fv(N045);
894         glVertex3fv(P045);
895         glNormal3fv(N061);
896         glVertex3fv(P061);
897         glEnd();
898 }
899
900 static void
901 Fish005(GLenum cap)
902 {
903         glBegin(cap);
904         glNormal3fv(N002);
905         glVertex3fv(P002);
906         glNormal3fv(N044);
907         glVertex3fv(P044);
908         glNormal3fv(N045);
909         glVertex3fv(P045);
910         glEnd();
911         glBegin(cap);
912         glNormal3fv(N002);
913         glVertex3fv(P002);
914         glNormal3fv(N043);
915         glVertex3fv(P043);
916         glNormal3fv(N044);
917         glVertex3fv(P044);
918         glEnd();
919         glBegin(cap);
920         glNormal3fv(N002);
921         glVertex3fv(P002);
922         glNormal3fv(N052);
923         glVertex3fv(P052);
924         glNormal3fv(N043);
925         glVertex3fv(P043);
926         glEnd();
927         glBegin(cap);
928         glNormal3fv(N002);
929         glVertex3fv(P002);
930         glNormal3fv(N051);
931         glVertex3fv(P051);
932         glNormal3fv(N052);
933         glVertex3fv(P052);
934         glEnd();
935         glBegin(cap);
936         glNormal3fv(N002);
937         glVertex3fv(P002);
938         glNormal3fv(N046);
939         glVertex3fv(P046);
940         glNormal3fv(N047);
941         glVertex3fv(P047);
942         glEnd();
943         glBegin(cap);
944         glNormal3fv(N002);
945         glVertex3fv(P002);
946         glNormal3fv(N047);
947         glVertex3fv(P047);
948         glNormal3fv(N048);
949         glVertex3fv(P048);
950         glEnd();
951         glBegin(cap);
952         glNormal3fv(N002);
953         glVertex3fv(P002);
954         glNormal3fv(N048);
955         glVertex3fv(P048);
956         glNormal3fv(N049);
957         glVertex3fv(P049);
958         glEnd();
959         glBegin(cap);
960         glNormal3fv(N002);
961         glVertex3fv(P002);
962         glNormal3fv(N049);
963         glVertex3fv(P049);
964         glNormal3fv(N050);
965         glVertex3fv(P050);
966         glEnd();
967         glBegin(cap);
968         glNormal3fv(N050);
969         glVertex3fv(P050);
970         glNormal3fv(N051);
971         glVertex3fv(P051);
972         glNormal3fv(N069);
973         glVertex3fv(P069);
974         glEnd();
975         glBegin(cap);
976         glNormal3fv(N051);
977         glVertex3fv(P051);
978         glNormal3fv(N002);
979         glVertex3fv(P002);
980         glNormal3fv(N069);
981         glVertex3fv(P069);
982         glEnd();
983         glBegin(cap);
984         glNormal3fv(N050);
985         glVertex3fv(P050);
986         glNormal3fv(N069);
987         glVertex3fv(P069);
988         glNormal3fv(N002);
989         glVertex3fv(P002);
990         glEnd();
991 }
992
993 static void
994 Fish006(GLenum cap)
995 {
996         glBegin(cap);
997         glNormal3fv(N066);
998         glVertex3fv(P066);
999         glNormal3fv(N016);
1000         glVertex3fv(P016);
1001         glNormal3fv(N026);
1002         glVertex3fv(P026);
1003         glEnd();
1004         glBegin(cap);
1005         glNormal3fv(N015);
1006         glVertex3fv(P015);
1007         glNormal3fv(N066);
1008         glVertex3fv(P066);
1009         glNormal3fv(N025);
1010         glVertex3fv(P025);
1011         glEnd();
1012         glBegin(cap);
1013         glNormal3fv(N025);
1014         glVertex3fv(P025);
1015         glNormal3fv(N066);
1016         glVertex3fv(P066);
1017         glNormal3fv(N026);
1018         glVertex3fv(P026);
1019         glEnd();
1020         glBegin(cap);
1021         glNormal3fv(N066);
1022         glVertex3fv(P066);
1023         glNormal3fv(N058);
1024         glVertex3fv(P058);
1025         glNormal3fv(N016);
1026         glVertex3fv(P016);
1027         glEnd();
1028         glBegin(cap);
1029         glNormal3fv(N015);
1030         glVertex3fv(P015);
1031         glNormal3fv(N058);
1032         glVertex3fv(P058);
1033         glNormal3fv(N066);
1034         glVertex3fv(P066);
1035         glEnd();
1036         glBegin(cap);
1037         glNormal3fv(N058);
1038         glVertex3fv(P058);
1039         glNormal3fv(N015);
1040         glVertex3fv(P015);
1041         glNormal3fv(N016);
1042         glVertex3fv(P016);
1043         glEnd();
1044 }
1045
1046 static void
1047 Fish007(GLenum cap)
1048 {
1049         glBegin(cap);
1050         glNormal3fv(N062);
1051         glVertex3fv(P062);
1052         glNormal3fv(N022);
1053         glVertex3fv(P022);
1054         glNormal3fv(N032);
1055         glVertex3fv(P032);
1056         glEnd();
1057         glBegin(cap);
1058         glNormal3fv(N062);
1059         glVertex3fv(P062);
1060         glNormal3fv(N032);
1061         glVertex3fv(P032);
1062         glNormal3fv(N064);
1063         glVertex3fv(P064);
1064         glEnd();
1065         glBegin(cap);
1066         glNormal3fv(N022);
1067         glVertex3fv(P022);
1068         glNormal3fv(N062);
1069         glVertex3fv(P062);
1070         glNormal3fv(N032);
1071         glVertex3fv(P032);
1072         glEnd();
1073         glBegin(cap);
1074         glNormal3fv(N062);
1075         glVertex3fv(P062);
1076         glNormal3fv(N064);
1077         glVertex3fv(P064);
1078         glNormal3fv(N032);
1079         glVertex3fv(P032);
1080         glEnd();
1081 }
1082
1083 static void
1084 Fish008(GLenum cap)
1085 {
1086         glBegin(cap);
1087         glNormal3fv(N063);
1088         glVertex3fv(P063);
1089         glNormal3fv(N019);
1090         glVertex3fv(P019);
1091         glNormal3fv(N029);
1092         glVertex3fv(P029);
1093         glEnd();
1094         glBegin(cap);
1095         glNormal3fv(N019);
1096         glVertex3fv(P019);
1097         glNormal3fv(N063);
1098         glVertex3fv(P063);
1099         glNormal3fv(N029);
1100         glVertex3fv(P029);
1101         glEnd();
1102         glBegin(cap);
1103         glNormal3fv(N063);
1104         glVertex3fv(P063);
1105         glNormal3fv(N029);
1106         glVertex3fv(P029);
1107         glNormal3fv(N065);
1108         glVertex3fv(P065);
1109         glEnd();
1110         glBegin(cap);
1111         glNormal3fv(N063);
1112         glVertex3fv(P063);
1113         glNormal3fv(N065);
1114         glVertex3fv(P065);
1115         glNormal3fv(N029);
1116         glVertex3fv(P029);
1117         glEnd();
1118 }
1119
1120 static void
1121 Fish009(GLenum cap)
1122 {
1123         glBegin(cap);
1124         glVertex3fv(P059);
1125         glVertex3fv(P012);
1126         glVertex3fv(P009);
1127         glVertex3fv(P060);
1128         glEnd();
1129         glBegin(cap);
1130         glVertex3fv(P012);
1131         glVertex3fv(P004);
1132         glVertex3fv(P007);
1133         glVertex3fv(P009);
1134         glEnd();
1135 }
1136
1137 static void
1138 Fish_1(GLenum cap)
1139 {
1140         Fish004(cap);
1141         Fish005(cap);
1142         Fish003(cap);
1143         Fish007(cap);
1144         Fish006(cap);
1145         Fish002(cap);
1146         Fish008(cap);
1147         Fish009(cap);
1148         Fish001(cap);
1149 }
1150
1151 static void
1152 Fish_2(GLenum cap)
1153 {
1154         Fish005(cap);
1155         Fish004(cap);
1156         Fish003(cap);
1157         Fish008(cap);
1158         Fish006(cap);
1159         Fish002(cap);
1160         Fish007(cap);
1161         Fish009(cap);
1162         Fish001(cap);
1163 }
1164
1165 static void
1166 Fish_3(GLenum cap)
1167 {
1168         Fish005(cap);
1169         Fish004(cap);
1170         Fish007(cap);
1171         Fish003(cap);
1172         Fish002(cap);
1173         Fish008(cap);
1174         Fish009(cap);
1175         Fish001(cap);
1176         Fish006(cap);
1177 }
1178
1179 static void
1180 Fish_4(GLenum cap)
1181 {
1182         Fish005(cap);
1183         Fish004(cap);
1184         Fish008(cap);
1185         Fish003(cap);
1186         Fish002(cap);
1187         Fish007(cap);
1188         Fish009(cap);
1189         Fish001(cap);
1190         Fish006(cap);
1191 }
1192
1193 static void
1194 Fish_5(GLenum cap)
1195 {
1196         Fish009(cap);
1197         Fish006(cap);
1198         Fish007(cap);
1199         Fish001(cap);
1200         Fish002(cap);
1201         Fish003(cap);
1202         Fish008(cap);
1203         Fish004(cap);
1204         Fish005(cap);
1205 }
1206
1207 static void
1208 Fish_6(GLenum cap)
1209 {
1210         Fish009(cap);
1211         Fish006(cap);
1212         Fish008(cap);
1213         Fish001(cap);
1214         Fish002(cap);
1215         Fish007(cap);
1216         Fish003(cap);
1217         Fish004(cap);
1218         Fish005(cap);
1219 }
1220
1221 static void
1222 Fish_7(GLenum cap)
1223 {
1224         Fish009(cap);
1225         Fish001(cap);
1226         Fish007(cap);
1227         Fish005(cap);
1228         Fish002(cap);
1229         Fish008(cap);
1230         Fish003(cap);
1231         Fish004(cap);
1232         Fish006(cap);
1233 }
1234
1235 static void
1236 Fish_8(GLenum cap)
1237 {
1238         Fish009(cap);
1239         Fish008(cap);
1240         Fish001(cap);
1241         Fish002(cap);
1242         Fish007(cap);
1243         Fish003(cap);
1244         Fish005(cap);
1245         Fish004(cap);
1246         Fish006(cap);
1247 }
1248
1249 void
1250 DrawShark(fishRec * fish, int wire)
1251 {
1252         float       mat[4][4];
1253         int         n;
1254         float       seg1, seg2, seg3, seg4, segup;
1255         float       thrash, chomp;
1256         GLenum      cap;
1257
1258         fish->htail = (int) (fish->htail - (int) (5.0 * fish->v)) % 360;
1259
1260         thrash = 50.0 * fish->v;
1261
1262         seg1 = 0.6 * thrash * sin(fish->htail * RRAD);
1263         seg2 = 1.8 * thrash * sin((fish->htail + 45.0) * RRAD);
1264         seg3 = 3.0 * thrash * sin((fish->htail + 90.0) * RRAD);
1265         seg4 = 4.0 * thrash * sin((fish->htail + 110.0) * RRAD);
1266
1267         chomp = 0.0;
1268         if (fish->v > 2.0) {
1269                 chomp = -(fish->v - 2.0) * 200.0;
1270         }
1271         P004[1] = iP004[1] + chomp;
1272         P007[1] = iP007[1] + chomp;
1273         P010[1] = iP010[1] + chomp;
1274         P011[1] = iP011[1] + chomp;
1275
1276         P023[0] = iP023[0] + seg1;
1277         P024[0] = iP024[0] + seg1;
1278         P025[0] = iP025[0] + seg1;
1279         P026[0] = iP026[0] + seg1;
1280         P027[0] = iP027[0] + seg1;
1281         P028[0] = iP028[0] + seg1;
1282         P029[0] = iP029[0] + seg1;
1283         P030[0] = iP030[0] + seg1;
1284         P031[0] = iP031[0] + seg1;
1285         P032[0] = iP032[0] + seg1;
1286         P033[0] = iP033[0] + seg2;
1287         P034[0] = iP034[0] + seg2;
1288         P035[0] = iP035[0] + seg2;
1289         P036[0] = iP036[0] + seg2;
1290         P037[0] = iP037[0] + seg2;
1291         P038[0] = iP038[0] + seg2;
1292         P039[0] = iP039[0] + seg2;
1293         P040[0] = iP040[0] + seg2;
1294         P041[0] = iP041[0] + seg2;
1295         P042[0] = iP042[0] + seg2;
1296         P043[0] = iP043[0] + seg3;
1297         P044[0] = iP044[0] + seg3;
1298         P045[0] = iP045[0] + seg3;
1299         P046[0] = iP046[0] + seg3;
1300         P047[0] = iP047[0] + seg3;
1301         P048[0] = iP048[0] + seg3;
1302         P049[0] = iP049[0] + seg3;
1303         P050[0] = iP050[0] + seg3;
1304         P051[0] = iP051[0] + seg3;
1305         P052[0] = iP052[0] + seg3;
1306         P002[0] = iP002[0] + seg4;
1307         P061[0] = iP061[0] + seg4;
1308         P069[0] = iP069[0] + seg4;
1309         P070[0] = iP070[0] + seg4;
1310
1311         fish->vtail += ((fish->dtheta - fish->vtail) * 0.1);
1312
1313         if (fish->vtail > 0.5) {
1314                 fish->vtail = 0.5;
1315         } else if (fish->vtail < -0.5) {
1316                 fish->vtail = -0.5;
1317         }
1318         segup = thrash * fish->vtail;
1319
1320         P023[1] = iP023[1] + segup;
1321         P024[1] = iP024[1] + segup;
1322         P025[1] = iP025[1] + segup;
1323         P026[1] = iP026[1] + segup;
1324         P027[1] = iP027[1] + segup;
1325         P028[1] = iP028[1] + segup;
1326         P029[1] = iP029[1] + segup;
1327         P030[1] = iP030[1] + segup;
1328         P031[1] = iP031[1] + segup;
1329         P032[1] = iP032[1] + segup;
1330         P033[1] = iP033[1] + segup * 5.0;
1331         P034[1] = iP034[1] + segup * 5.0;
1332         P035[1] = iP035[1] + segup * 5.0;
1333         P036[1] = iP036[1] + segup * 5.0;
1334         P037[1] = iP037[1] + segup * 5.0;
1335         P038[1] = iP038[1] + segup * 5.0;
1336         P039[1] = iP039[1] + segup * 5.0;
1337         P040[1] = iP040[1] + segup * 5.0;
1338         P041[1] = iP041[1] + segup * 5.0;
1339         P042[1] = iP042[1] + segup * 5.0;
1340         P043[1] = iP043[1] + segup * 12.0;
1341         P044[1] = iP044[1] + segup * 12.0;
1342         P045[1] = iP045[1] + segup * 12.0;
1343         P046[1] = iP046[1] + segup * 12.0;
1344         P047[1] = iP047[1] + segup * 12.0;
1345         P048[1] = iP048[1] + segup * 12.0;
1346         P049[1] = iP049[1] + segup * 12.0;
1347         P050[1] = iP050[1] + segup * 12.0;
1348         P051[1] = iP051[1] + segup * 12.0;
1349         P052[1] = iP052[1] + segup * 12.0;
1350         P002[1] = iP002[1] + segup * 17.0;
1351         P061[1] = iP061[1] + segup * 17.0;
1352         P069[1] = iP069[1] + segup * 17.0;
1353         P070[1] = iP070[1] + segup * 17.0;
1354
1355         glPushMatrix();
1356
1357         glTranslatef(0.0, 0.0, -3000.0);
1358
1359         glGetFloatv(GL_MODELVIEW_MATRIX, &mat[0][0]);
1360         n = 0;
1361         if (mat[0][2] >= 0.0) {
1362                 n += 1;
1363         }
1364         if (mat[1][2] >= 0.0) {
1365                 n += 2;
1366         }
1367         if (mat[2][2] >= 0.0) {
1368                 n += 4;
1369         }
1370         glScalef(2.0, 1.0, 1.0);
1371
1372         glEnable(GL_CULL_FACE);
1373         cap = wire ? GL_LINE_LOOP : GL_POLYGON;
1374         switch (n) {
1375                 case 0:
1376                         Fish_1(cap);
1377                         break;
1378                 case 1:
1379                         Fish_2(cap);
1380                         break;
1381                 case 2:
1382                         Fish_3(cap);
1383                         break;
1384                 case 3:
1385                         Fish_4(cap);
1386                         break;
1387                 case 4:
1388                         Fish_5(cap);
1389                         break;
1390                 case 5:
1391                         Fish_6(cap);
1392                         break;
1393                 case 6:
1394                         Fish_7(cap);
1395                         break;
1396                 case 7:
1397                         Fish_8(cap);
1398                         break;
1399         }
1400         glDisable(GL_CULL_FACE);
1401
1402         glPopMatrix();
1403 }
1404 #endif