5 float rx,rxamt,ry,ryamt;
7 float[] org_coordsX(70);
8 float[] org_coordsY(70);
9 float[] org_coordsZ(70);
10 float[] org_colorR(70);
11 float[] org_colorG(70);
12 float[] org_colorB(70);
19 float signX,signY,signZ;
39 if(BASS < 0.2f){signZ = 1;}
40 if(MIDDLE < 0.2f){signY = -1;}
41 if(TREBLE < 0.2f){signX = -1;}
43 for (int i = 0; i< stacks; i++)
45 float temp = Cos(3.14159f/6.0f*i-3.14159f/2.0f);
46 for (int j = 0; j < segments; j++)
48 org_coordsY[Fabs(i*segments+j)] = Sin(3.14159f/6.0f*i-3.14159f/2.0f);
49 org_coordsX[Fabs(i*segments+j)] = Cos(2*3.14159f/segments*j) * temp;
50 org_coordsZ[Fabs(i*segments+j)] = Sin(2*3.14159f/segments*j) * temp;
53 for (int i = 0; i< stacks; i++)
55 for (int j = 0; j< segments; j++)
57 org_colorR[i*segments+j] = Sin(i);
58 org_colorG[i*segments+j] = Sin(j);
59 org_colorB[i*segments+j] = 1-Sin(j);
76 gfxBegin(PRIM_TRIANGLELIST);
77 for (int i = 0; i< stacks-2; i++)
79 for (int j = 0; j< segments; j++)
81 float temp = i*segments+j;
82 addX = GetSpec(Fabs(temp/2)) * org_coordsX[temp]*scale;
83 addY = GetSpec(Fabs(temp/2)) * org_coordsY[temp]*scale;
84 addZ = GetSpec(Fabs(temp/2)) * org_coordsZ[temp]*scale;
85 colorVal = GetSpec(Fabs(temp/2));
88 gfxColour(org_colorR[temp],org_colorG[temp] ,org_colorB[temp] ,1);
89 gfxVertex(org_coordsX[temp] + addX,org_coordsY[temp] + addY,org_coordsZ[temp] + addZ);
91 temp = (i+1)*segments+((j+1)%segments);
92 gfxVertex(org_coordsX[temp] + addX,org_coordsY[temp] + addY,org_coordsZ[temp] + addZ);
94 temp = i*segments+((j+1)%segments);
95 gfxVertex(org_coordsX[temp] + addX,org_coordsY[temp] + addY,org_coordsZ[temp] + addZ);
98 addX = GetSpec(Fabs(temp/2)) * org_coordsX[temp]*scale;
99 addY = GetSpec(Fabs(temp/2)) * org_coordsY[temp]*scale;
100 addZ = GetSpec(Fabs(temp/2)) * org_coordsZ[temp]*scale;
101 colorVal = GetSpec(Fabs(temp/2));
103 gfxColour(org_colorR[temp],org_colorG[temp],org_colorB[temp],1);
104 gfxVertex(org_coordsX[temp] + addX,org_coordsY[temp] + addY,org_coordsZ[temp] + addZ);
106 temp = (i+1)*segments+j;
107 gfxVertex(org_coordsX[temp] + addX,org_coordsY[temp] + addY,org_coordsZ[temp] + addZ);
109 temp = (i+1)*segments+((j+1)%segments);
110 gfxVertex(org_coordsX[temp] + addX,org_coordsY[temp] + addY,org_coordsZ[temp] + addZ);
118 if (Abs(BASS) > 0.3f){velZ += BASS*3.0f;}
119 if (Abs(BASS) < 0.3f){velZ -= BASS*3.0f;}
120 if (Abs(MIDDLE) > 0.3f){velY += MIDDLE*3.0f;}
121 if (Abs(MIDDLE) < 0.3f){velY -= MIDDLE*3.0f;}
122 if (Abs(TREBLE) > 0.3f){velX += TREBLE*3.0f;}
123 if (Abs(TREBLE) < 0.3f){velX -= TREBLE*3.0f;}
125 velX = Clamp(velX,-3.0f,3.0f);
126 velY = Clamp(velY,-3.0f,3.0f);
127 velZ = Clamp(velZ,-3.0f,3.0f);
129 posX += signX*velX*TIMEPASS;
130 posY += signY*velY*TIMEPASS;
131 posZ += signZ*velZ*TIMEPASS;
133 if (posX < -4 || posX > 4){signX = -signX;}
134 if (posY < -4 || posY > 4){signY = -signY;}
135 if (posZ < -4 || posZ > 4){signZ = -signZ;}
137 gfxTranslate(posX,posY,posZ);
150 float s = Mag(dx,dy)/Mag(16,12);
153 map.SetValues(x, y, 0.1, 0.1, 0.8,0.8, 0.8);
155 map.SetValues(x, y, dx*s*0.1*Fabs(BASS), dy*s*0.1*Fabs(BASS), 0.8,0.8, 0.8);
161 gfxSetRenderTarget(map);
163 gfxTranslate(0,0,15);
167 if (BASS>0.3) ryamt = 1;
168 if (BASS<-0.3) ryamt = -1;
169 ry = ry + (ryamt*TIMEPASS);
171 gfxRotate(ry*90,0,1,0);
178 gfxSetRenderTarget(0);
179 gfxSetEnvTexture(NULL);
183 gfxTranslate(0, 0, 2.414);
184 gfxColour(1, 1, 1, 1);
185 gfxTexRect(-1, 1, 1, -1);