3 Copyright (C) 2001-2003 Paolo Martella
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License
7 as published by the Free Software Foundation; either version 2
8 of the License, or (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
29 static Texture
* i_Text
;
30 static GLuint numtexs
=21;
31 static GLuint width
=800;
32 static GLuint height
=600;
33 static bool init
=true;
34 static GLfloat i_time
=0;
36 static long i_gettime
;
38 static GLfloat i_timer
=0.0f
;
39 static GLfloat i_radius
[7];
40 static GLfloat i_zeta
=0.4f
;
41 static GLfloat i_scale
;
42 static GLfloat i_shade
;
43 static GLfloat i_incr
=180.0f
;
46 static void i_rst(int);
48 static const int i_num
=10;
49 static const int i_numray
=100;
64 static i_part rays
[i_numray
];
65 static int i_alpha
[i_num
];
69 i_Text
=new Texture
[numtexs
];
70 i_Text
[1].Load("data/you.raw");
71 i_Text
[2].Load("data/youglow.raw");
72 i_Text
[3].Load("data/gotta.raw");
73 i_Text
[4].Load("data/gottaglow.raw");
74 i_Text
[5].Load("data/say.raw");
75 i_Text
[6].Load("data/sayglow.raw");
76 i_Text
[7].Load("data/yes.raw");
77 i_Text
[8].Load("data/yesglow.raw");
78 i_Text
[9].Load("data/cl.raw");
79 i_Text
[10].Load("data/text1.raw");
80 i_Text
[11].Load("data/xp10.raw");
81 i_Text
[12].Load("data/basic2.raw");
82 i_Text
[13].Load("data/cl2.raw");
83 i_Text
[14].Load("data/excess.raw");
84 i_Text
[15].Load("data/excessglow.raw");
85 i_Text
[16].Load("data/another.raw");
86 i_Text
[17].Load("data/anotherglow.raw");
87 i_Text
[18].Load("data/to.raw");
88 i_Text
[19].Load("data/toglow.raw");
89 i_Text
[20].Load("data/esaflr.raw");
91 glMatrixMode(GL_PROJECTION
); // Select The Projection Matrix
93 gluPerspective(45.0f
,(GLfloat
)width
/(GLfloat
)height
,0.1f
,4.6f
);
94 glMatrixMode(GL_MODELVIEW
);
96 glShadeModel(GL_SMOOTH
);
97 glClearColor(0.0f
, 0.0f
, 0.0f
, 0.0f
);
99 glDisable(GL_DEPTH_TEST
);
101 for (int i
=0; i
<7; i
++) i_radius
[i
]=-1.5f
;
103 for (int i
=0;i
<i_numray
;i
++) i_rst(i
);
105 for (int i
=0;i
<i_num
;i
++) i_alpha
[i
]=(int)(128-12.8*(GLfloat
)i
/i_num
);
107 glHint(GL_PERSPECTIVE_CORRECTION_HINT
, GL_NICEST
);
108 glPolygonMode(GL_FRONT_AND_BACK
, GL_FILL
);
109 glEnable(GL_TEXTURE_2D
);
110 glDisable (GL_CULL_FACE
);
111 glEnable(GL_POINT_SMOOTH
);
112 glBlendFunc(GL_SRC_ALPHA
,GL_ONE_MINUS_SRC_COLOR
);
116 void i_drawquad(GLfloat size
)
119 glTexCoord2f(0.0f
, 0.0f
);
120 glVertex3f(-0.5f
*size
,-0.5f
*size
,0.0f
);
121 glTexCoord2f(1.0f
, 0.0f
);
122 glVertex3f(0.5f
*size
,-0.5f
*size
,0.0f
);
123 glTexCoord2f(1.0f
, 1.0f
);
124 glVertex3f(0.5f
*size
,0.5f
*size
,0.0f
);
125 glTexCoord2f(0.0f
, 1.0f
);
126 glVertex3f(-0.5f
*size
,0.5f
*size
,0.0f
);
130 void i_drawtqd(GLfloat size
,GLfloat off
,int a
,int r
,int g
,int b
)
134 glTexCoord2f(0.0f
+off
, 0.0f
);
135 glVertex3f(-0.5f
*size
,-0.5f
*size
,0.0f
);
138 glTexCoord2f(0.5f
+off
, 0.0f
);
139 glVertex3f(0.5f
*size
,-0.5f
*size
,0.0f
);
141 glTexCoord2f(0.5f
+off
, 1.0f
);
142 glVertex3f(0.5f
*size
,0.5f
*size
,0.0f
);
145 glTexCoord2f(0.0f
+off
, 1.0f
);
146 glVertex3f(-0.5f
*size
,0.5f
*size
,0.0f
);
150 void i_drawtqd1(GLfloat size
,GLfloat off
,int a
,int r
,int g
,int b
)
154 glTexCoord2f(0.0f
+off
, 0.0f
);
155 glVertex3f(-0.5f
*size
,-0.5f
*size
,0.0f
);
158 glTexCoord2f(0.5f
+off
, 0.0f
);
159 glVertex3f(0.5f
*size
,-0.5f
*size
,0.0f
);
161 glTexCoord2f(0.5f
+off
, 1.0f
);
162 glVertex3f(0.5f
*size
,0.5f
*size
,0.0f
);
165 glTexCoord2f(0.0f
+off
, 1.0f
);
166 glVertex3f(-0.5f
*size
,0.5f
*size
,0.0f
);
170 void i_drawtri(GLfloat r
,GLfloat g
,GLfloat b
,GLfloat a
,GLfloat size
)
172 glBegin(GL_TRIANGLE_FAN
);
173 glColor4f(r
/2,g
/2,b
/2,a
);
176 glVertex3f(0,.5*size
,7);
180 glVertex3f(0,-.5*size
,7);
212 rays
[i_x
].size
=.25f
+.0015f
*((GLfloat
)(rand()%1000));
213 rays
[i_x
].phase
=.180*(GLfloat
)(rand()%1000);
214 rays
[i_x
].xspd
=.1f
+.001f
*((GLfloat
)(rand()%1000));
215 rays
[i_x
].yspd
=.1f
+.001f
*((GLfloat
)(rand()%1000));
218 rays
[i_x
].r
=.001f
*((GLfloat
)(rand()%1000));
219 rays
[i_x
].g
=.001f
*((GLfloat
)(rand()%1000));
220 rays
[i_x
].b
=.001f
*((GLfloat
)(rand()%1000));
221 rays
[i_x
].a
=.0005f
*((GLfloat
)(rand()%1000));
222 rays
[i_x
].i_shade
=0.0f
;
224 rays
[i_x
].start
=i_gettime
;
226 bool i_DrawGLScene(GLfloat globtime
)
228 if (init
) {i_InitGL();init
=false;}
232 glClear(GL_COLOR_BUFFER_BIT
| GL_DEPTH_BUFFER_BIT
);
234 glBlendFunc(GL_SRC_ALPHA
,GL_ONE
);
237 glTranslatef(0,0,-5+i_zeta
);
239 glEnable(GL_TEXTURE_GEN_S
); ///////////////////// STROBE
240 glEnable(GL_TEXTURE_GEN_T
);
241 glTexGeni(GL_S
, GL_TEXTURE_GEN_MODE
, GL_SPHERE_MAP
);
242 glTexGeni(GL_T
, GL_TEXTURE_GEN_MODE
, GL_SPHERE_MAP
);
243 //glBindTexture(GL_TEXTURE_2D, texture[9]);
246 glRotatef(45*(i_radius
[0]+i_radius
[1]),1,0,0);
247 glRotatef(45*(i_radius
[1]+i_radius
[2])+10*i_timer
,0,1,0);
248 glRotatef(45*(i_radius
[2]+i_radius
[3]),0,0,1);
249 glRotatef(45*(i_radius
[3]+i_radius
[4]),1,0,1);
250 glRotatef(45*(i_radius
[4]+i_radius
[5]),1,1,0);
251 glRotatef(45*(i_radius
[5]+i_radius
[6]),0,1,1);
252 glScalef(.05,.05,.05);
253 glColor4ub(255,255,255,192+rand()%63);
254 glutSolidDodecahedron();
257 glDisable(GL_TEXTURE_GEN_S
);
258 glDisable(GL_TEXTURE_GEN_T
);
259 //glBindTexture(GL_TEXTURE_2D, texture[10]);
261 glColor4f(cos(i_radius
[0])*cos(i_radius
[0])+cos(i_radius
[3])*cos(i_radius
[3])+cos(i_radius
[4])*cos(i_radius
[4])+cos(i_radius
[5])*cos(i_radius
[5]),
262 cos(i_radius
[1])*cos(i_radius
[1])+cos(i_radius
[4])*cos(i_radius
[4]),
263 cos(i_radius
[2])*cos(i_radius
[2])+cos(i_radius
[3])*cos(i_radius
[3])+cos(i_radius
[6])*cos(i_radius
[6])+cos(i_radius
[6])*cos(i_radius
[6]),
266 //glBindTexture(GL_TEXTURE_2D, texture[11]);
268 i_drawquad(.75+.5*cos(2*(i_radius
[0]+i_radius
[1]+i_radius
[2]+i_radius
[3]+i_radius
[4]+i_radius
[5]+i_radius
[6])));
269 glRotatef(10*(i_radius
[0]+i_radius
[1]+i_radius
[2]+i_radius
[3]+i_radius
[4]+i_radius
[5]+i_radius
[6]),0,0,1);
270 glColor4f(1.0f
,1.0f
,1.0f
,1.0f
);
271 //glBindTexture(GL_TEXTURE_2D, texture[10]);
273 i_drawquad(.5+.25*sin(i_radius
[0]+i_radius
[1]+i_radius
[2]+i_radius
[3]+i_radius
[4]+i_radius
[5]+i_radius
[6]));
275 glEnable(GL_TEXTURE_GEN_S
);
276 glEnable(GL_TEXTURE_GEN_T
);
277 glTexGeni(GL_S
, GL_TEXTURE_GEN_MODE
, GL_EYE_LINEAR
);
278 glTexGeni(GL_T
, GL_TEXTURE_GEN_MODE
, GL_EYE_LINEAR
);
280 if ((i_radius
[0]>-1.495)&&(i_radius
[0]<1.495))
282 glPushMatrix(); // YOU RAY
283 if (i_radius
[0]<-1.0f
) i_shade
=1.0f
+2*(i_radius
[0]+1.0f
); else
284 if (i_radius
[0]>1.0f
) i_shade
=1.0f
-2*(i_radius
[0]-1.0f
); else
286 glRotatef(60*i_radius
[0],0,1,0);
287 glTexGeni(GL_S
, GL_TEXTURE_GEN_MODE
, GL_EYE_LINEAR
);
288 glTexGeni(GL_T
, GL_TEXTURE_GEN_MODE
, GL_EYE_LINEAR
);
289 //glBindTexture(GL_TEXTURE_2D, texture[8]);
291 glBegin(GL_TRIANGLE_FAN
);
292 glColor4f(0.5f
,0.162f
,0.067f
,i_shade
*(0.625f
+0.0025f
*((GLfloat
)(rand()%100))));
295 glVertex3f(0,2.25+.00025*(GLfloat
)(rand()%100),3);
296 glColor4f(1.0f
,0.375f
,0.125f
,i_shade
*(0.625f
+0.0025f
*((GLfloat
)(rand()%100))));
299 glVertex3f(0,.9+.00025*(GLfloat
)(rand()%100),3);
301 glDisable(GL_TEXTURE_GEN_S
);
302 glDisable(GL_TEXTURE_GEN_T
);
305 ///////////////////////////////////////////////////// YOU
307 glTranslatef(0,1.25,0);
308 if ((i_radius
[0]>-1.495)&&(i_radius
[0]<1.495))
310 glBlendFunc(GL_ZERO
,GL_ONE_MINUS_SRC_COLOR
);
312 glTranslatef(i_radius
[0]*.5,0,0);
314 glColor4ub((int) ((GLfloat
)255*i_shade
),(int) ((GLfloat
)255*i_shade
),(int) ((GLfloat
)255*i_shade
),255);
315 //glBindTexture(GL_TEXTURE_2D, texture[0]);
320 glBlendFunc(GL_SRC_ALPHA
,GL_ONE
);
321 //glBindTexture(GL_TEXTURE_2D, texture[1]);
323 for (i_x
=0; i_x
<i_num
; i_x
++)
325 i_alpha
[i_x
]=(int)(128-64*(1+i_radius
[0]));
327 glTranslatef(1+i_radius
[0]*2.5,0,.5*(GLfloat
)i_x
/i_num
);
329 i_scale
=.5+i_radius
[0]/2;
330 i_drawtqd(1,i_scale
,(int) ((GLfloat
)i_alpha
[i_x
]*i_shade
),255,160,64);
333 for (i_x
=0; i_x
<i_num
; i_x
++)
335 i_alpha
[i_x
]=(int)(64*(1+i_radius
[0]));
337 glTranslatef(-1+i_radius
[0]*2.5,0,.5*(GLfloat
)i_x
/i_num
);
339 i_scale
=i_radius
[0]/2;
340 i_drawtqd1(1,i_scale
,(int) ((GLfloat
)i_alpha
[i_x
]*i_shade
),255,160,64);
345 if ((i_radius
[1]>-1.495)&&(i_radius
[1]<1.495))
347 glPushMatrix(); // GOTTA RAY
348 if (i_radius
[1]<-1.0f
) i_shade
=1.0f
+2*(i_radius
[1]+1.0f
); else
349 if (i_radius
[1]>1.0f
) i_shade
=1.0f
-2*(i_radius
[1]-1.0f
); else
351 glEnable(GL_TEXTURE_GEN_S
);
352 glEnable(GL_TEXTURE_GEN_T
);
353 //glBindTexture(GL_TEXTURE_2D, texture[8]);
356 glTranslatef(0,0,-5+i_zeta
);
357 glRotatef(60*i_radius
[1],0,1,0);
358 glBegin(GL_TRIANGLE_FAN
);
359 glColor4f(0.067f
,0.5f
,0.162f
,i_shade
*(0.625f
+0.0025f
*((GLfloat
)(rand()%100))));
362 glVertex3f(0,1+.00025*(GLfloat
)(rand()%100),5);
363 glColor4f(0.125f
,1.0f
,0.375f
,i_shade
*(0.625f
+0.0025f
*((GLfloat
)(rand()%100))));
366 glVertex3f(0,-.05+.00025*(GLfloat
)(rand()%100),5);
368 glDisable(GL_TEXTURE_GEN_S
);
369 glDisable(GL_TEXTURE_GEN_T
);
373 ///////////////////////////////////////////////////// GOTTA
375 glTranslatef(0,-1,0);
376 if ((i_radius
[1]>-1.495)&&(i_radius
[1]<1.495))
378 glBlendFunc(GL_ZERO
,GL_ONE_MINUS_SRC_COLOR
);
380 glTranslatef(i_radius
[1]*.5,0,0);
382 glColor4ub((int) ((GLfloat
)255*i_shade
),(int) ((GLfloat
)255*i_shade
),(int) ((GLfloat
)255*i_shade
),255);
383 //glBindTexture(GL_TEXTURE_2D, texture[2]);
388 glBlendFunc(GL_SRC_ALPHA
,GL_ONE
);
389 //glBindTexture(GL_TEXTURE_2D, texture[3]);
391 for (i_x
=0; i_x
<i_num
; i_x
++)
393 i_alpha
[i_x
]=(int)(128-64*(1+i_radius
[1]));
395 glTranslatef(1+i_radius
[1]*2.5,0,.5*(GLfloat
)i_x
/i_num
);
397 i_scale
=.5+i_radius
[1]/2;
398 i_drawtqd(1,i_scale
,(int) ((GLfloat
)i_alpha
[i_x
]*i_shade
),64,255,160);
401 for (i_x
=0; i_x
<i_num
; i_x
++)
403 i_alpha
[i_x
]=(int)(64*(1+i_radius
[1]));
405 glTranslatef(-1+i_radius
[1]*2.5,0,.5*(GLfloat
)i_x
/i_num
);
407 i_scale
=i_radius
[1]/2;
408 i_drawtqd1(1,i_scale
,(int)((GLfloat
)i_alpha
[i_x
]*i_shade
),64,255,160);
413 if ((i_radius
[3]>-1.495)&&(i_radius
[3]<1.495))
415 glPushMatrix(); // YES RAY
416 if (i_radius
[3]<-1.0f
) i_shade
=1.0f
+2*(i_radius
[3]+1.0f
); else
417 if (i_radius
[3]>1.0f
) i_shade
=1.0f
-2*(i_radius
[3]-1.0f
); else
419 glEnable(GL_TEXTURE_GEN_S
);
420 glEnable(GL_TEXTURE_GEN_T
);
421 //glBindTexture(GL_TEXTURE_2D, texture[8]);
424 glTranslatef(0,0,-5+i_zeta
);
425 glRotatef(60*i_radius
[3],0,1,0);
426 glBegin(GL_TRIANGLE_FAN
);
427 glColor4f(0.5f
,0.162f
,0.5f
,i_shade
*(0.625f
+0.0025f
*((GLfloat
)(rand()%100))));
430 glVertex3f(0,-1+.00025*(GLfloat
)(rand()%100),3);
431 glColor4f(1.0f
,0.375f
,1.0f
,i_shade
*(0.625f
+0.0025f
*((GLfloat
)(rand()%100))));
432 glVertex3f(0,-1.5,3);
434 glVertex3f(0,-2.+.00025*(GLfloat
)(rand()%100),3);
436 glDisable(GL_TEXTURE_GEN_S
);
437 glDisable(GL_TEXTURE_GEN_T
);
441 ///////////////////////////////////////////////////// YES
443 glTranslatef(0,-1.6,0);
444 if ((i_radius
[3]>-1.495)&&(i_radius
[3]<1.495))
446 glBlendFunc(GL_ZERO
,GL_ONE_MINUS_SRC_COLOR
);
448 glTranslatef(i_radius
[3]*.5,0,0);
450 glColor4ub((int)((GLfloat
)255*i_shade
),(int)((GLfloat
)255*i_shade
),(int)((GLfloat
)255*i_shade
),255);
451 //glBindTexture(GL_TEXTURE_2D, texture[6]);
456 glBlendFunc(GL_SRC_ALPHA
,GL_ONE
);
457 //glBindTexture(GL_TEXTURE_2D, texture[7]);
459 for (i_x
=0; i_x
<i_num
; i_x
++)
461 i_alpha
[i_x
]=(int)(128-64*(1+i_radius
[3]));
463 glTranslatef(1+i_radius
[3]*2.5,0,.5*(GLfloat
)i_x
/i_num
);
465 i_scale
=.5+i_radius
[3]/2;
466 i_drawtqd(1,i_scale
,(int)((GLfloat
)i_alpha
[i_x
]*i_shade
),255,128,255);
469 for (i_x
=0; i_x
<i_num
; i_x
++)
471 i_alpha
[i_x
]=(int)(64*(1+i_radius
[3]));
473 glTranslatef(-1+i_radius
[3]*2.5,0,.5*(GLfloat
)i_x
/i_num
);
475 i_scale
=i_radius
[3]/2;
476 i_drawtqd1(1,i_scale
,(int)((GLfloat
)i_alpha
[i_x
]*i_shade
),255,128,255);
481 if ((i_radius
[2]>-1.495)&&(i_radius
[2]<1.495))
483 glPushMatrix(); // SAY RAY
484 if (i_radius
[2]<-1.0f
) i_shade
=1.0f
+2*(i_radius
[2]+1.0f
); else
485 if (i_radius
[2]>1.0f
) i_shade
=1.0f
-2*(i_radius
[2]-1.0f
); else
487 glEnable(GL_TEXTURE_GEN_S
);
488 glEnable(GL_TEXTURE_GEN_T
);
489 //glBindTexture(GL_TEXTURE_2D, texture[8]);
492 glTranslatef(0,0,-5+i_zeta
);
493 glRotatef(60*i_radius
[2],0,1,0);
494 glBegin(GL_TRIANGLE_FAN
);
495 glColor4f(0.067f
,0.162f
,0.5f
,i_shade
*(0.625f
+0.0025f
*((GLfloat
)(rand()%100))));
498 glVertex3f(0,-.25+.00025*(GLfloat
)(rand()%100),4);
499 glColor4f(0.125f
,0.375f
,1.0f
,i_shade
*(0.625f
+0.0025f
*((GLfloat
)(rand()%100))));
502 glVertex3f(0,-1.3+.00025*(GLfloat
)(rand()%100),4);
504 glDisable(GL_TEXTURE_GEN_S
);
505 glDisable(GL_TEXTURE_GEN_T
);
509 ///////////////////////////////////////////////////// SAY
511 glTranslatef(0,.85,0);
512 if ((i_radius
[2]>-1.495)&&(i_radius
[2]<1.495))
514 glBlendFunc(GL_ZERO
,GL_ONE_MINUS_SRC_COLOR
);
516 glTranslatef(i_radius
[2]*.5,0,0);
518 glColor4ub((int)((GLfloat
)255*i_shade
),(int)((GLfloat
)255*i_shade
),(int)((GLfloat
)255*i_shade
),255);
519 //glBindTexture(GL_TEXTURE_2D, texture[4]);
524 glBlendFunc(GL_SRC_ALPHA
,GL_ONE
);
525 //glBindTexture(GL_TEXTURE_2D, texture[5]);
527 for (i_x
=0; i_x
<i_num
; i_x
++)
529 i_alpha
[i_x
]=(int)(128-64*(1+i_radius
[2]));
531 glTranslatef(1+i_radius
[2]*2.5,0,.5*(GLfloat
)i_x
/i_num
);
533 i_scale
=.5+i_radius
[2]/2;
534 i_drawtqd(1,i_scale
,(int)((GLfloat
)i_alpha
[i_x
]*i_shade
),64,160,255);
537 for (i_x
=0; i_x
<i_num
; i_x
++)
539 i_alpha
[i_x
]=(int)(64*(1+i_radius
[2]));
541 glTranslatef(-1+i_radius
[2]*2.5,0,.5*(GLfloat
)i_x
/i_num
);
543 i_scale
=i_radius
[2]/2;
544 i_drawtqd1(1,i_scale
,(int)((GLfloat
)i_alpha
[i_x
]*i_shade
),64,160,255);
549 if ((i_radius
[4]>-1.495)&&(i_radius
[4]<1.495))
551 glPushMatrix(); // TO RAY
552 if (i_radius
[4]<-1.0f
) i_shade
=1.0f
+2*(i_radius
[4]+1.0f
); else
553 if (i_radius
[4]>1.0f
) i_shade
=1.0f
-2*(i_radius
[4]-1.0f
); else
555 glEnable(GL_TEXTURE_GEN_S
);
556 glEnable(GL_TEXTURE_GEN_T
);
557 //glBindTexture(GL_TEXTURE_2D, texture[8]);
560 glTranslatef(0,0,-5+i_zeta
);
561 glRotatef(60*i_radius
[4],0,1,0);
562 glBegin(GL_TRIANGLE_FAN
);
563 glColor4f(0.5f
,0.162f
,0.067f
,i_shade
*(0.625f
+0.0025f
*((GLfloat
)(rand()%100))));
566 glVertex3f(0,2.5+.00025*(GLfloat
)(rand()%100),4);
567 glColor4f(0.5f
,0.162f
,0.067f
,i_shade
*(0.625f
+0.0025f
*((GLfloat
)(rand()%100))));
568 glVertex3f(0,1.75,4);
570 glVertex3f(0,1+.00025*(GLfloat
)(rand()%100),4);
572 glDisable(GL_TEXTURE_GEN_S
);
573 glDisable(GL_TEXTURE_GEN_T
);
577 ///////////////////////////////////////////////////// TO
579 glTranslatef(0,1.5,0);
580 if ((i_radius
[4]>-1.495)&&(i_radius
[4]<1.495))
582 glBlendFunc(GL_ZERO
,GL_ONE_MINUS_SRC_COLOR
);
584 glTranslatef(i_radius
[4]*.5,0,0);
586 glColor4ub((int)((GLfloat
)255*i_shade
),(int)((GLfloat
)255*i_shade
),(int)((GLfloat
)255*i_shade
),255);
587 //glBindTexture(GL_TEXTURE_2D, texture[17]);
592 glBlendFunc(GL_SRC_ALPHA
,GL_ONE
);
593 //glBindTexture(GL_TEXTURE_2D, texture[18]);
595 for (i_x
=0; i_x
<i_num
; i_x
++)
597 i_alpha
[i_x
]=(int)(128-64*(1+i_radius
[4]));
599 glTranslatef(1+i_radius
[4]*2.5,0,.5*(GLfloat
)i_x
/i_num
);
601 i_scale
=.5+i_radius
[4]/2;
602 i_drawtqd(1,i_scale
,(int)((GLfloat
)i_alpha
[i_x
]*i_shade
),255,160,64);
605 for (i_x
=0; i_x
<i_num
; i_x
++)
607 i_alpha
[i_x
]=(int)(64*(1+i_radius
[4]));
609 glTranslatef(-1+i_radius
[4]*2.5,0,.5*(GLfloat
)i_x
/i_num
);
611 i_scale
=i_radius
[4]/2;
612 i_drawtqd1(1,i_scale
,(int)((GLfloat
)i_alpha
[i_x
]*i_shade
),255,160,64);
617 if ((i_radius
[5]>-1.495)&&(i_radius
[5]<1.495))
619 glPushMatrix(); // ANOTHER RAY
620 if (i_radius
[5]<-1.0f
) i_shade
=1.0f
+2*(i_radius
[5]+1.0f
); else
621 if (i_radius
[5]>1.0f
) i_shade
=1.0f
-2*(i_radius
[5]-1.0f
); else
623 glEnable(GL_TEXTURE_GEN_S
);
624 glEnable(GL_TEXTURE_GEN_T
);
625 //glBindTexture(GL_TEXTURE_2D, texture[8]);
628 glTranslatef(0,0,-5+i_zeta
);
629 glRotatef(30*i_radius
[5],0,1,0);
630 glBegin(GL_TRIANGLE_FAN
);
631 glColor4f(0.5f
,0.162f
,0.067f
,i_shade
*(0.625f
+0.0025f
*((GLfloat
)(rand()%100))));
634 glVertex3f(0,-.25+.00025*(GLfloat
)(rand()%100),4);
635 glColor4f(0.5f
,0.162f
,0.067f
,i_shade
*(0.625f
+0.0025f
*((GLfloat
)(rand()%100))));
638 glVertex3f(0,-1.3+.00025*(GLfloat
)(rand()%100),4);
640 glDisable(GL_TEXTURE_GEN_S
);
641 glDisable(GL_TEXTURE_GEN_T
);
645 ///////////////////////////////////////////////////// ANOTHER
647 glTranslatef(0,-2,0);
648 if ((i_radius
[5]>-1.495)&&(i_radius
[5]<1.495))
650 glBlendFunc(GL_ZERO
,GL_ONE_MINUS_SRC_COLOR
);
652 glTranslatef(i_radius
[5]*.5,0,0);
654 glColor4ub((int)((GLfloat
)255*i_shade
),(int)((GLfloat
)255*i_shade
),(int)((GLfloat
)255*i_shade
),255);
655 //glBindTexture(GL_TEXTURE_2D, texture[15]);
660 glBlendFunc(GL_SRC_ALPHA
,GL_ONE
);
661 //glBindTexture(GL_TEXTURE_2D, texture[16]);
663 for (i_x
=0; i_x
<i_num
; i_x
++)
665 i_alpha
[i_x
]=(int)(128-64*(1+i_radius
[5]));
667 glTranslatef(1+i_radius
[5]*2.5,0,.25*(GLfloat
)i_x
/i_num
);
669 i_scale
=.5+i_radius
[5]/2;
670 i_drawtqd(1,i_scale
,(int)((GLfloat
)i_alpha
[i_x
]*i_shade
),255,96,96);
673 for (i_x
=0; i_x
<i_num
; i_x
++)
675 i_alpha
[i_x
]=(int)(64*(1+i_radius
[5]));
677 glTranslatef(-1+i_radius
[5]*2.5,0,.25*(GLfloat
)i_x
/i_num
);
679 i_scale
=i_radius
[5]/2;
680 i_drawtqd1(1,i_scale
,(int)((GLfloat
)i_alpha
[i_x
]*i_shade
),255,96,96);
685 if ((i_radius
[6]>-1.495)&&(i_radius
[6]<1.495))
687 glPushMatrix(); // EXCESS RAY
688 if (i_radius
[6]<-1.0f
) i_shade
=1.0f
+2*(i_radius
[6]+1.0f
); else
689 if (i_radius
[6]>1.0f
) i_shade
=1.0f
-2*(i_radius
[6]-1.0f
); else
691 glEnable(GL_TEXTURE_GEN_S
);
692 glEnable(GL_TEXTURE_GEN_T
);
693 //glBindTexture(GL_TEXTURE_2D, texture[8]);
696 glTranslatef(0,0,-5+i_zeta
);
697 glRotatef(30*i_radius
[6],0,1,0);
698 glBegin(GL_TRIANGLE_FAN
);
699 glColor4f(0.067f
*2,0.162f
*2,0.5f
*2,i_shade
*(0.625f
+0.0025f
*((GLfloat
)(rand()%100))));
702 glVertex3f(0,.35+.00025*(GLfloat
)(rand()%100),3);
703 glColor4f(0.125f
*2,0.375f
*2,1.0f
*2,i_shade
*(0.625f
+0.0025f
*((GLfloat
)(rand()%100))));
706 glVertex3f(0,-.35+.00025*(GLfloat
)(rand()%100),3);
708 glDisable(GL_TEXTURE_GEN_S
);
709 glDisable(GL_TEXTURE_GEN_T
);
713 ///////////////////////////////////////////////////// EXCESS
716 if ((i_radius
[6]>-1.495)&&(i_radius
[6]<1.495))
719 glBlendFunc(GL_ZERO
,GL_ONE_MINUS_SRC_COLOR
);
721 glTranslatef(-i_radius
[6]*1.5,0,.5);
723 glColor4ub((int)((GLfloat
)255*i_shade
),(int)((GLfloat
)255*i_shade
),(int)((GLfloat
)255*i_shade
),255);
724 //glBindTexture(GL_TEXTURE_2D, texture[13]);
726 glTexParameterf(GL_TEXTURE_2D
,GL_TEXTURE_WRAP_S
, GL_CLAMP
);
727 glTexParameterf(GL_TEXTURE_2D
,GL_TEXTURE_WRAP_T
, GL_CLAMP
);
731 glBlendFunc(GL_SRC_ALPHA
,GL_ONE
);
732 //glBindTexture(GL_TEXTURE_2D, texture[14]);
734 glTexParameterf(GL_TEXTURE_2D
,GL_TEXTURE_WRAP_S
, GL_CLAMP
);
735 glTexParameterf(GL_TEXTURE_2D
,GL_TEXTURE_WRAP_T
, GL_CLAMP
);
736 for (i_x
=0; i_x
<i_num
; i_x
++)
738 i_alpha
[i_x
]=(int)(128-64*(1+i_radius
[6]));
740 glTranslatef(2+i_radius
[6]*2.5,0,.5+.75*(GLfloat
)i_x
/i_num
);
742 i_scale
=.5+i_radius
[6]/2;
743 i_drawtqd(1,i_scale
,(int)((GLfloat
)i_alpha
[i_x
]*i_shade
),96,128,255);
746 for (i_x
=0; i_x
<i_num
; i_x
++)
748 i_alpha
[i_x
]=(int)(64*(1+i_radius
[6]));
750 glTranslatef(-2+i_radius
[6]*2.5,0,.5+.75*(GLfloat
)i_x
/i_num
);
752 i_scale
=i_radius
[6]/2;
753 i_drawtqd1(1,i_scale
,(int)((GLfloat
)i_alpha
[i_x
]*i_shade
),96,128,255);
758 glTexParameterf(GL_TEXTURE_2D
,GL_TEXTURE_WRAP_S
, GL_REPEAT
);
759 glTexParameterf(GL_TEXTURE_2D
,GL_TEXTURE_WRAP_T
, GL_REPEAT
);
760 glTranslatef(0,0,0); //////////////////////////////////////// RAYS
761 glEnable(GL_TEXTURE_GEN_S
);
762 glEnable(GL_TEXTURE_GEN_T
);
763 glTexGeni(GL_S
, GL_TEXTURE_GEN_MODE
, GL_EYE_LINEAR
);
764 glTexGeni(GL_T
, GL_TEXTURE_GEN_MODE
, GL_EYE_LINEAR
);
765 //glBindTexture(GL_TEXTURE_2D, texture[8]);
768 for (int r
=0; r
<i_numray
; r
++)
770 GLfloat time
=(GLfloat
)(i_gettime
-rays
[r
].start
)/25.0f
;
773 if ((r
%2)==0) sign
=1; else sign
=-1;
774 glRotatef(sign
*rays
[r
].phase
+sign
*rays
[r
].i_x
,1,0,0);
775 glRotatef(sign
*rays
[r
].phase
+sign
*rays
[r
].y
,0,1,0);
776 //if (((rays[r].phase+rays[r].i_x>-90)&&(rays[r].phase+rays[r].i_x<90))&&((rays[r].phase+rays[r].y>-90)&&(rays[r].phase+rays[r].y<90)))
777 i_drawtri(rays
[r
].r
,rays
[r
].g
,rays
[r
].b
,rays
[r
].i_shade
+.00005*((GLfloat
)(rand()%1000)),rays
[r
].size
);
778 rays
[r
].i_x
=rays
[r
].xspd
*time
;
779 rays
[r
].y
=rays
[r
].yspd
*time
;
780 if (time
*(rays
[r
].phase
+10.0f
)/3000.0f
<2.0f
*3.1415f
) rays
[r
].i_shade
=rays
[r
].a
*(1.0f
-cos(time
*(rays
[r
].phase
+10.0f
)/3000.0f
))/2.0f
;
785 glDisable(GL_TEXTURE_GEN_S
);
786 glDisable(GL_TEXTURE_GEN_T
);
789 //glBindTexture(GL_TEXTURE_2D, texture[12]);
791 glColor4f(1,1,1,.15f
);
793 glScalef(3.0f
+3.0f
*(-cos(i_timer
/2.5f
)+1.0f
),3.0f
+3.0f
*(-cos(i_timer
/2.5f
)+1.0f
),1);
794 glRotatef(i_incr
,0,0,1);
798 glScalef(3.0f
+3.0f
*(cos(i_timer
/2.5f
)+1.0f
),3.0f
+3.0f
*(cos(i_timer
/2.5f
)+1.0f
),1);
799 glRotatef(-i_incr
,0,0,1);
804 i_timer
=((GLfloat
)(i_gettime
))/500.0f
;
805 i_incr
=i_timer
*10.0f
;
809 GLfloat shader
=1.0f
-i_timer
/4.0f
;
810 glBlendFunc(GL_ZERO
,GL_ONE_MINUS_SRC_COLOR
);
811 //glDisable(GL_DEPTH_TEST);
812 glDisable(GL_TEXTURE_2D
);
814 glTranslatef(0,0,-1.0f
);
815 glColor4f(shader
,shader
,shader
,.5);
817 glEnable(GL_TEXTURE_2D
);
818 glBlendFunc(GL_SRC_ALPHA
,GL_ONE
);
822 GLfloat shader
=(i_timer
-102.0f
)/6.0f
;
823 glBlendFunc(GL_ZERO
,GL_ONE_MINUS_SRC_COLOR
);
824 //glDisable(GL_DEPTH_TEST);
825 glDisable(GL_TEXTURE_2D
);
827 glTranslatef(0,0,-1.0f
);
828 glColor4f(shader
,shader
,shader
,.5);
830 glEnable(GL_TEXTURE_2D
);
831 glBlendFunc(GL_SRC_ALPHA
,GL_ONE
);
839 if ((i_timer
>3.5f
)&&(i_timer
<6.5f
))
842 glDisable(GL_TEXTURE_2D
);
843 glTranslatef(0,0,-1.0f
);
844 glColor4f(1,1,1,.5f
-.5f
*cos((i_timer
-3.5f
)*3.1415f
/1.5f
));
846 glEnable(GL_TEXTURE_2D
);
848 if ((i_timer
>91.5f
)&&(i_timer
<97.5f
))
851 glDisable(GL_TEXTURE_2D
);
852 glTranslatef(0,0,-1.0f
);
853 if (i_timer
<93.5f
) glColor4f(1,1,1,.5f
-.5f
*cos((i_timer
-91.5f
)*3.1415f
/2.0f
));
854 else glColor4f(1,1,1,.5f
+.5f
*cos((i_timer
-93.5f
)*3.1415f
/4.0f
));
856 glEnable(GL_TEXTURE_2D
);
862 float i_offset
=96.5f
;
863 if ((i_timer
>i_offset
)&&(i_timer
<i_offset
+1.0f
))
865 float alphaval
=1.0f
-sin((i_timer
-i_offset
)*3.1415f
/2.0f
);
867 for (int rep
=1; rep
<5; rep
++)
870 glTranslatef(0,.5,-1.0f
+(float)(rep
)/5.0f
+3.0f
*(-i_timer
+i_offset
));
871 glColor4f(1,1,1,alphaval
/rep
);
872 glScalef(2.0f
,.75f
,1);
876 glTranslatef(0,0,-1.0f
);
877 glColor4f(1,1,1,alphaval
/2.0f
);
878 glDisable(GL_TEXTURE_2D
);
880 glEnable(GL_TEXTURE_2D
);
883 if ((i_timer
>i_offset
)&&(i_timer
<i_offset
+1.0f
))
885 float alphaval
=1.0f
-sin((i_timer
-i_offset
)*3.1415f
/2.0f
);
887 for (int rep
=1; rep
<5; rep
++)
890 glTranslatef(0,.166,-1.0f
+(float)(rep
)/5.0f
+3.0f
*(-i_timer
+i_offset
));
891 glColor4f(1,1,1,alphaval
/rep
);
892 glScalef(2.0f
,.5f
,1);
896 glTranslatef(0,.166,-1.0f+3.0f*(-i_timer+i_offset));
897 glColor4f(1,1,1,alphaval);
898 glScalef(2.0f,.5f,1);
901 glTranslatef(0,0,-1.0f
);
902 glColor4f(1,1,1,alphaval
/2.0f
);
903 glDisable(GL_TEXTURE_2D
);
905 glEnable(GL_TEXTURE_2D
);
908 if ((i_timer
>i_offset
)&&(i_timer
<i_offset
+1.0f
))
910 float alphaval
=1.0f
-sin((i_timer
-i_offset
)*3.1415f
/2.0f
);
912 for (int rep
=1; rep
<5; rep
++)
915 glTranslatef(0,-.166,-1.0f
+(float)(rep
)/5.0f
+3.0f
*(-i_timer
+i_offset
));
916 glColor4f(1,1,1,alphaval
/rep
);
917 glScalef(2.0f
,.55f
,1);
921 glTranslatef(0,-.166,-1.0f+3.0f*(-i_timer+i_offset));
923 glColor4f(1,1,1,alphaval);
924 glScalef(2.0f,.55f,1);
928 glTranslatef(0,0,-1.0f
);
929 glColor4f(1,1,1,alphaval
/2.0f
);
930 glDisable(GL_TEXTURE_2D
);
932 glEnable(GL_TEXTURE_2D
);
935 if ((i_timer
>i_offset
)&&(i_timer
<i_offset
+2.0f
))
937 float alphaval
=1.0f
-sin((i_timer
-i_offset
)*3.1415f
/4.0f
);
939 for (int rep
=1; rep
<5; rep
++)
942 glTranslatef(0,-.5,-1.5f
+(float)(rep
)/5.0f
+1.5f
*(-i_timer
+i_offset
));
943 glColor4f(1,1,1,alphaval
/rep
);
944 glScalef(2.0f
,.55f
,1);
949 glTranslatef(0,-.5,-1.0f+3.0f*(-i_timer+i_offset));
951 glColor4f(1,1,1,alphaval);
952 glScalef(2.0f,.55f,1);
956 glTranslatef(0,0,-1.0f
);
957 glColor4f(1,1,1,alphaval
/2.0f
);
958 glDisable(GL_TEXTURE_2D
);
960 glEnable(GL_TEXTURE_2D
);
963 if ((i_timer
>i_offset
)&&(i_timer
<i_offset
+1.0f
))
965 float alphaval
=1.0f
-sin((i_timer
-i_offset
)*3.1415f
/2.0f
);
967 for (int rep
=1; rep
<5; rep
++)
970 glTranslatef(0,.25,-1.0f
+(float)(rep
)/5.0f
+3.0f
*(-i_timer
+i_offset
));
971 glColor4f(1,1,1,alphaval
/rep
);
972 glScalef(1.5f
,.55f
,1);
977 glTranslatef(0,.25,-1.0f+3.0f*(-i_timer+i_offset));
978 glColor4f(1,1,1,alphaval);
979 glScalef(1.5f,.55f,1);
983 glTranslatef(0,0,-1.0f
);
984 glColor4f(1,1,1,alphaval
/2.0f
);
985 glDisable(GL_TEXTURE_2D
);
987 glEnable(GL_TEXTURE_2D
);
990 if ((i_timer
>i_offset
)&&(i_timer
<i_offset
+1.0f
))
992 float alphaval
=1.0f
-sin((i_timer
-i_offset
)*3.1415f
/2.0f
);
994 for (int rep
=1; rep
<5; rep
++)
997 glTranslatef(0,-.25,-1.0f
+(float)(rep
)/5.0f
+3.0f
*(-i_timer
+i_offset
));
998 glColor4f(1,1,1,alphaval
/rep
);
999 glScalef(2.0f
,.25f
,1);
1004 glTranslatef(0,-.25,-1.0f+3.0f*(-i_timer+i_offset));
1005 glColor4f(1,1,1,alphaval);
1006 glScalef(2.0f,.25f,1);
1010 glTranslatef(0,0,-1.0f
);
1011 glColor4f(1,1,1,alphaval
/2.0f
);
1012 glDisable(GL_TEXTURE_2D
);
1014 glEnable(GL_TEXTURE_2D
);
1017 if ((i_timer
>i_offset
)&&(i_timer
<i_offset
+4.0f
))
1019 float alphaval
=1.0f
-sin((i_timer
-i_offset
)*3.1415f
/8.0f
);
1021 for (int rep
=1; rep
<5; rep
++)
1024 glTranslatef(0,0,-1.0f
+(float)(rep
)/5.0f
-1.5f
*sqrt(i_timer
-i_offset
));
1025 glColor4f(1,1,1,alphaval
/rep
);
1026 glScalef(2.0f
,.65f
,1);
1031 glTranslatef(0,0,-2.0f);//+1.2f*(-i_timer+i_offset));
1032 glColor4f(1,1,1,alphaval);
1033 glScalef(2.0f,.6f,1);
1037 glTranslatef(0,0,-1.0f
);
1038 glColor4f(1,1,1,alphaval
/2.0f
);
1039 glDisable(GL_TEXTURE_2D
);
1041 glEnable(GL_TEXTURE_2D
);
1045 if (i_radius
[0]<1.495f
) i_radius
[0]=-1.5f
+((GLfloat
)(i_gettime
))/4000.0f
;
1046 for (int i
=1; i
<7; i
++)
1048 //if (benchmode) {if ((i_radius[i-1]>0)&&(i_radius[i]<.745f)) i_radius[i]=-1.5f+((GLfloat)(i_gettime-limit-6000*i))/2000.0f;}
1050 {if ((i_radius
[i
-1]>0)&&(i_radius
[i
]<1.495f
)) i_radius
[i
]=-1.5f
+((GLfloat
)(i_gettime
-6000*i
))/4000.0f
;}
1055 //********************* FINISH
1060 i_gettime
=(long int)i_time
;