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

◆ draw()

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

Implements fl::IAnimartrix2Viz.

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

12 {
13 auto *e = ctx.mEngine.get();
14 e->get_ready();
15
16 e->timings.master_speed = 0.03;
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.0033;
21 e->timings.ratio[4] = 0.0036;
22 e->timings.ratio[5] = 0.0039;
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 e->animation.dist = e->distance[x][y] * (e->move.directional[0]);
30 e->animation.angle = e->polar_theta[x][y] + e->move.radial[0];
31 e->animation.z = 5;
32 e->animation.scale_x = 0.09;
33 e->animation.scale_y = 0.09;
34 e->animation.offset_z = 5 * e->move.linear[0];
35 e->animation.offset_x = 0;
36 e->animation.offset_y = 0;
37 float show1 = e->render_value(e->animation);
38
39 e->animation.dist = e->distance[x][y] * e->move.directional[1];
40 e->animation.angle = e->polar_theta[x][y] + e->move.radial[1];
41 e->animation.z = 50;
42 e->animation.scale_x = 0.07;
43 e->animation.scale_y = 0.07;
44 e->animation.offset_z = 5 * e->move.linear[1];
45 e->animation.offset_x = 0;
46 e->animation.offset_y = 0;
47 float show2 = e->render_value(e->animation);
48
49 e->animation.dist = e->distance[x][y] * e->move.directional[2];
50 e->animation.angle = e->polar_theta[x][y] + e->move.radial[2];
51 e->animation.z = 500;
52 e->animation.scale_x = 0.05;
53 e->animation.scale_y = 0.05;
54 e->animation.offset_z = 5 * e->move.linear[2];
55 e->animation.offset_x = 0;
56 e->animation.offset_y = 0;
57 float show3 = e->render_value(e->animation);
58
59 e->pixel.red = show1;
60 e->pixel.green = show2;
61 e->pixel.blue = show3;
62
63 e->pixel = e->rgb_sanity_check(e->pixel);
64
65 e->setPixelColorInternal(x, y, e->pixel);
66 }
67 }
68}

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