FastLED 3.10.8
Loading...
Searching...
No Matches

◆ draw()

void fl::SpiralMatrix10::draw ( Context & ctx)
overridevirtual

Implements fl::IAnimartrix2Viz.

Definition at line 12 of file spiral_matrix10.cpp.hpp.

12 {
13 auto *e = ctx.mEngine.get();
14 e->get_ready();
15
16 e->timings.master_speed = 0.006;
17 e->timings.ratio[0] = 0.025;
18 e->timings.ratio[1] = 0.027;
19 e->timings.ratio[2] = 0.031;
20 e->timings.ratio[3] = 0.0053;
21 e->timings.ratio[4] = 0.0056;
22 e->timings.ratio[5] = 0.0059;
23
24 e->calculate_oscillators(e->timings);
25
26 for (int x = 0; x < e->num_x; x++) {
27 for (int y = 0; y < e->num_y; y++) {
28
29 float scale = 0.6;
30
31 e->animation.dist = e->distance[x][y];
32 e->animation.angle = e->polar_theta[x][y];
33 e->animation.z = 5;
34 e->animation.scale_x = 0.09 * scale;
35 e->animation.scale_y = 0.09 * scale;
36 e->animation.offset_y = -30 * e->move.linear[0];
37 e->animation.offset_z = 0;
38 e->animation.offset_x = 0;
39 e->animation.low_limit = -1;
40 e->show1 = e->render_value(e->animation);
41
42 e->animation.dist = e->distance[x][y];
43 e->animation.angle = e->polar_theta[x][y];
44 e->animation.z = 50;
45 e->animation.scale_x = 0.09 * scale;
46 e->animation.scale_y = 0.09 * scale;
47 e->animation.offset_y = -30 * e->move.linear[1];
48 e->animation.offset_z = 0;
49 e->animation.offset_x = 0;
50 e->animation.low_limit = -1;
51 e->show2 = e->render_value(e->animation);
52
53 e->animation.dist = e->distance[x][y];
54 e->animation.angle = e->polar_theta[x][y] + 2 + (e->show1 / 255) * PI;
55 e->animation.z = 5;
56 e->animation.scale_x = 0.09 * scale;
57 e->animation.scale_y = 0.09 * scale;
58 e->animation.offset_y = -10 * e->move.linear[0];
59 e->animation.offset_z = 0;
60 e->animation.offset_x = 0;
61 e->animation.low_limit = 0;
62 e->show3 = e->render_value(e->animation);
63
64 e->animation.dist = e->distance[x][y];
65 e->animation.angle = e->polar_theta[x][y] + 2 + (e->show2 / 255) * PI;
66 ;
67 e->animation.z = 5;
68 e->animation.scale_x = 0.09 * scale;
69 e->animation.scale_y = 0.09 * scale;
70 e->animation.offset_y = -20 * e->move.linear[0];
71 e->animation.offset_z = 0;
72 e->animation.offset_x = 0;
73 e->animation.low_limit = 0;
74 e->show4 = e->render_value(e->animation);
75
76 e->show5 = e->screen(e->show4, e->show3);
77 e->show6 = e->colordodge(e->show5, e->show3);
78
79 e->pixel.red = (e->show5 + e->show6) / 2;
80 e->pixel.green = (e->show5 - 50) + (e->show6 / 16);
81 e->pixel.blue = 0;
82
83 e->pixel = e->rgb_sanity_check(e->pixel);
84
85 e->setPixelColorInternal(x, y, e->pixel);
86 }
87 }
88}
fl::UISlider scale("Scale", 4,.1, 4,.1)
#define PI

References fl::FL_NO_EXCEPT, PI, scale, fl::x, and fl::y.