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

◆ draw()

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

Implements fl::IAnimartrix2Viz.

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

12 {
13 auto *e = ctx.mEngine.get();
14 e->get_ready();
15
16 e->timings.master_speed = 0.01;
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.033;
21 e->timings.ratio[4] = 0.037;
22 e->timings.ratio[5] = 0.0038;
23 e->timings.ratio[6] = 0.041;
24
25 e->calculate_oscillators(e->timings);
26
27 for (int x = 0; x < e->num_x; x++) {
28 for (int y = 0; y < e->num_y; y++) {
29
30 e->animation.dist = e->distance[x][y];
31 e->animation.angle = 16 * e->polar_theta[x][y] + 16 * e->move.radial[0];
32 e->animation.z = 5;
33 e->animation.scale_x = 0.06;
34 e->animation.scale_y = 0.06;
35 e->animation.offset_z = -10 * e->move.linear[0];
36 e->animation.offset_y = 10 * e->move.noise_angle[0];
37 e->animation.offset_x = 10 * e->move.noise_angle[4];
38 e->animation.low_limit = 0;
39 e->show1 = e->render_value(e->animation);
40
41 e->animation.dist = e->distance[x][y];
42 e->animation.angle = 16 * e->polar_theta[x][y] + 16 * e->move.radial[1];
43 e->animation.z = 500;
44 e->animation.scale_x = 0.06;
45 e->animation.scale_y = 0.06;
46 e->animation.offset_z = -10 * e->move.linear[1];
47 e->animation.offset_y = 10 * e->move.noise_angle[1];
48 e->animation.offset_x = 10 * e->move.noise_angle[3];
49 e->animation.low_limit = 0;
50 e->show2 = e->render_value(e->animation);
51
52 e->pixel.red = e->show1;
53 e->pixel.green = 0;
54 e->pixel.blue = e->show2;
55
56 e->pixel = e->rgb_sanity_check(e->pixel);
57
58 e->setPixelColorInternal(x, y, e->pixel);
59 }
60 }
61}

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