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

◆ draw()

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

Implements fl::IAnimartrix2Viz.

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

11 {
12 auto *e = ctx.mEngine.get();
13 e->get_ready();
14
15 e->timings.master_speed = 0.01;
16 e->timings.ratio[0] = 0.0025;
17 e->timings.ratio[1] = 0.0027;
18 e->timings.ratio[2] = 0.029;
19 e->timings.ratio[3] = 0.033;
20
21 e->calculate_oscillators(e->timings);
22
23 for (int x = 0; x < e->num_x; x++) {
24 for (int y = 0; y < e->num_y; y++) {
25
26 e->animation.dist =
27 e->distance[x][y] - (12 + e->move.directional[3] * 4);
28 e->animation.angle = e->move.noise_angle[0] + e->move.noise_angle[1] +
29 e->polar_theta[x][y];
30 e->animation.z = 5;
31 e->animation.scale_x = 0.1;
32 e->animation.scale_y = 0.1;
33 e->animation.offset_z = -10;
34 e->animation.offset_y = 20 * e->move.linear[2];
35 e->animation.offset_x = 10;
36 e->animation.low_limit = 0;
37 e->show1 = e->render_value(e->animation);
38
39 e->pixel.red = e->show1;
40 e->pixel.green = e->show1 - 80;
41 e->pixel.blue = e->show1 - 150;
42
43 e->pixel = e->rgb_sanity_check(e->pixel);
44
45 e->setPixelColorInternal(x, y, e->pixel);
46 }
47 }
48}

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