Created
October 1, 2025 06:43
-
-
Save StefanPetrick/a5e81693492d97e701e1c943f7349d4c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void fluffy_blobs_wallpaper() { | |
| //get_ready(); // SmartMatrix only | |
| //rgb24 *buffer = backgroundLayer.backBuffer(); // SmartMatrix only | |
| // Here are some global parameters to play with | |
| timings.master_speed = 0.015; // master speed dial for everything | |
| float size = 0.15; // size of the blobs - think of it as a global zoom factor | |
| float radial_speed = 1; // changes the speed of the rotations only | |
| float linear_speed = 5; // changes the speed of the linear movements only | |
| timings.ratio[0] = 0.025; // set up 9 oscillators and detune their frequencies slighly | |
| timings.ratio[1] = 0.026; | |
| timings.ratio[2] = 0.027; | |
| timings.ratio[3] = 0.028; | |
| timings.ratio[4] = 0.029; | |
| timings.ratio[5] = 0.030; | |
| timings.ratio[6] = 0.031; | |
| timings.ratio[7] = 0.032; | |
| timings.ratio[8] = 0.033; | |
| calculate_oscillators(timings); | |
| for (int x = 0; x < num_x; x++) { | |
| for (int y = 0; y < num_y; y++) { | |
| // render 9 layers with the same effect at slighliy different speeds and sizes | |
| animation.dist = distance[x][y]; | |
| animation.angle = polar_theta[x][y] + (radial_speed * move.radial[0]); | |
| animation.z = 5; | |
| animation.scale_x = size; | |
| animation.scale_y = size; | |
| animation.offset_z = 0; | |
| animation.offset_x = 0; | |
| animation.offset_y = linear_speed * move.linear[0]; | |
| animation.low_limit = 0; | |
| animation.high_limit = 1; | |
| show1 = render_value(animation); | |
| animation.angle = polar_theta[x][y] + (radial_speed * move.radial[1]); | |
| animation.offset_y = linear_speed * move.linear[1]; | |
| animation.offset_z = 200; | |
| animation.scale_x = size * 1.1; | |
| animation.scale_y = size * 1.1; | |
| show2 = render_value(animation); | |
| animation.angle = polar_theta[x][y] + (radial_speed * move.radial[2]); | |
| animation.offset_y = linear_speed * move.linear[2]; | |
| animation.offset_z = 400; | |
| animation.scale_x = size * 1.2; | |
| animation.scale_y = size * 1.2; | |
| show3 = render_value(animation); | |
| animation.angle = polar_theta[x][y] + (radial_speed * move.radial[3]); | |
| animation.offset_y = linear_speed * move.linear[3]; | |
| animation.offset_z = 600; | |
| animation.scale_x = size; | |
| animation.scale_y = size; | |
| show4 = render_value(animation); | |
| animation.angle = polar_theta[x][y] + (radial_speed * move.radial[4]); | |
| animation.offset_y = linear_speed * move.linear[4]; | |
| animation.offset_z = 800; | |
| animation.scale_x = size * 1.1; | |
| animation.scale_y = size * 1.1; | |
| show5 = render_value(animation); | |
| animation.angle = polar_theta[x][y] + (radial_speed * move.radial[5]); | |
| animation.offset_y = linear_speed * move.linear[5]; | |
| animation.offset_z = 1800; | |
| animation.scale_x = size * 1.2; | |
| animation.scale_y = size * 1.2; | |
| show6 = render_value(animation); | |
| animation.angle = polar_theta[x][y] + (radial_speed * move.radial[6]); | |
| animation.offset_y = linear_speed * move.linear[6]; | |
| animation.offset_z = 2800; | |
| animation.scale_x = size; | |
| animation.scale_y = size; | |
| show7 = render_value(animation); | |
| animation.angle = polar_theta[x][y] + (radial_speed * move.radial[7]); | |
| animation.offset_y = linear_speed * move.linear[7]; | |
| animation.offset_z = 3800; | |
| animation.scale_x = size * 1.1; | |
| animation.scale_y = size * 1.1; | |
| show8 = render_value(animation); | |
| animation.angle = polar_theta[x][y] + (radial_speed * move.radial[8]); | |
| animation.offset_y = linear_speed * move.linear[8]; | |
| animation.offset_z = 4800; | |
| animation.scale_x = size * 1.2; | |
| animation.scale_y = size * 1.2; | |
| show9 = render_value(animation); | |
| // the factors modulate the color mix and overall appearance of the animations | |
| pixel.red = 0.8 * (show1 + show2 + show3) + (show4 + show5 + show6); // red ist the sum of layer 1, 2, 3 | |
| // I also add layer 4, 5, 6 (which modulates green) | |
| // in order to add orange/yello to the mix | |
| pixel.green = 0.8 * (show4 + show5 + show6); // green ist the sum of layer 4, 5, 6 | |
| pixel.blue = 0.3 * (show7 + show8 + show9); // blue is the sum of layer 7, 8, 9 | |
| pixel = rgb_sanity_check(pixel); | |
| leds[xy(x, y)] = CRGB(pixel.red, pixel.green, pixel.blue); | |
| //buffer[xy(x, y)] = (rgb24)CRGB(CRGB(pixel.red, pixel.green, pixel.blue)); // SmartMatrix only | |
| } | |
| } | |
| FastLED.show(); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment