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