comparison Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/atlantis/shark.c @ 3331:d44a0a913aa2

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