@@ -16,37 +16,43 @@ class ParticleTrailEffect : public ParticleEffect
1616
1717 float angle1;
1818 float angle2;
19+ float angle3;
20+
1921 float baseHue;
2022
2123 virtual void beginFrame (const FrameInfo &f)
2224 {
2325 const float tailLength = 8 .0f ;
24- const float speed = 9 .0f ;
26+ const float speed = 0 .04f ; // SLOW
27+ // const float speed = 5.09f; //FAST
2528 const float lfoRatio = 0 .15f ;
29+ const float notLfoRatio = 0 .01f ;
2630 const float hueRate = 0 .01f ;
2731 const float brightness = 40 .0f ;
2832 const unsigned numParticles = 200 ;
2933
3034 // Low frequency oscillators
3135 angle1 = fmodf (angle1 + f.timeDelta * speed, 2 * M_PI);
3236 angle2 = fmodf (angle2 + f.timeDelta * speed * lfoRatio, 2 * M_PI);
37+ angle3 = fmodf (angle3 + f.timeDelta * speed * notLfoRatio, 2 * M_PI);
3338 baseHue = fmodf (baseHue + f.timeDelta * speed * hueRate, 1 .0f );
3439
3540 appearance.resize (numParticles);
3641 for (unsigned i = 0 ; i < numParticles; i++) {
3742 float s = float (i) / numParticles;
3843 float tail = s * tailLength;
3944
40- float radius = 0.2 + 1.5 * s;
41- float x = radius * cos (angle1 + tail);
45+ float radius = 0.2 + 2.0 * s;
46+ float x = radius * cos (angle1 + tail) * 2.0 + 1.0 ;
4247 float y = radius * sin (angle1 + tail + 10.0 * sin (angle2 + tail * lfoRatio));
48+ float z = radius * cos (angle3 + tail);
4349 float hue = baseHue + s * 0.4 ;
4450
4551 ParticleAppearance& p = appearance[i];
46- p.point = Vec3 (x, 0 , y );
52+ p.point = Vec3 (x, y, z );
4753 p.intensity = (brightness / numParticles) * s;
48- p.radius = 0.1 + 0 . 4f * s;
49- hsv2rgb (p.color , hue, 0.5 , 0.8 );
54+ p.radius = 0.1 + 1 . 2f * s; // MADE BIG
55+ hsv2rgb (p.color , hue, 0.5 , 1.0 );
5056 }
5157
5258 ParticleEffect::beginFrame (f);
0 commit comments