FastLED 3.9.15
Loading...
Searching...
No Matches

◆ draw()

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

Implements fl::IAnimartrix2Viz.

Definition at line 11 of file complex_kaleido.cpp.hpp.

11 {
12 auto *e = ctx.mEngine.get();
13 e->get_ready();
14
15 e->timings.master_speed = 0.009;
16 e->timings.ratio[0] = 0.025;
17 e->timings.ratio[1] = 0.027;
18 e->timings.ratio[2] = 0.031;
19 e->timings.ratio[3] = 0.0053;
20 e->timings.ratio[4] = 0.0056;
21 e->timings.ratio[5] = 0.0059;
22
23 e->calculate_oscillators(e->timings);
24
25 for (int x = 0; x < e->num_x; x++) {
26 for (int y = 0; y < e->num_y; y++) {
27
28 e->animation.dist = e->distance[x][y];
29 e->animation.angle = 5 * e->polar_theta[x][y] + 10 * e->move.radial[0] +
30 e->animation.dist / 2;
31 e->animation.z = 5;
32 e->animation.scale_x = 0.07;
33 e->animation.scale_y = 0.07;
34 e->animation.offset_z = 0;
35 e->animation.offset_x = -30 * e->move.linear[0];
36 e->animation.offset_y = 0;
37 e->animation.low_limit = 0;
38 e->show1 = e->render_value(e->animation);
39
40 e->animation.dist = e->distance[x][y];
41 e->animation.angle = -5 * e->polar_theta[x][y] + 12 * e->move.radial[1] +
42 e->animation.dist / 2;
43 e->animation.z = 500;
44 e->animation.scale_x = 0.07;
45 e->animation.scale_y = 0.07;
46 e->animation.offset_z = 0;
47 e->animation.offset_x = -30 * e->move.linear[1];
48 e->animation.offset_y = 0;
49 e->animation.low_limit = 0;
50 e->show2 = e->render_value(e->animation);
51
52 e->animation.dist = e->distance[x][y];
53 e->animation.angle = -5 * e->polar_theta[x][y] + 12 * e->move.radial[2] +
54 e->animation.dist / 2;
55 e->animation.z = 500;
56 e->animation.scale_x = 0.05;
57 e->animation.scale_y = 0.05;
58 e->animation.offset_z = 0;
59 e->animation.offset_x = -40 * e->move.linear[2];
60 e->animation.offset_y = 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 = 5 * e->polar_theta[x][y] + 12 * e->move.radial[3] +
66 e->animation.dist / 2;
67 e->animation.z = 500;
68 e->animation.scale_x = 0.09;
69 e->animation.scale_y = 0.09;
70 e->animation.offset_z = 0;
71 e->animation.offset_x = -35 * e->move.linear[3];
72 e->animation.offset_y = 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->show2, e->show3);
78
79 float radius = e->radial_filter_radius;
80 float radial = (radius - e->distance[x][y]) / e->distance[x][y];
81
82 e->pixel.red = radial * (e->show1 + e->show2);
83 e->pixel.green = 0.3 * radial * e->show6;
84 e->pixel.blue = radial * e->show5;
85
86 e->pixel = e->rgb_sanity_check(e->pixel);
87
88 e->setPixelColorInternal(x, y, e->pixel);
89 }
90 }
91}

References fl::Context::mEngine, fl::x, and fl::y.