I would like to build a 3x3 matrix of 10x10 matrices using a total of 900 APA102 LEDs (9 x 100 = 900). I would like to use 1 Pixelblaze v3 that has a segment feature in Settings.
I have been testing a Pixelblaze v2 and a SP108E for background lighting of my wall art. The SP108E has a Settings feature that allows you to divide the total number of LEDs into equal segments. Each segment then runs the same pattern in sync – no expansion card or additional controllers needed.
The mapper in Pixelblaze v3 could save 300x300 and 10x10 patterns. The 10x10 patterns would run in sync on the 9 matrices. The 300x300 patterns would run across all 900 LEDs.
Now when you render using render3d, you can choose to only render a given pattern on the right “segment”…
Just by using a simple check/case based onZ,
Makes sense?
Given that Z will be “normalized”
To a 0…1 value (so even if you used integers, it’ll get changed to a decimal), so number each using a value that you know will be “normalized” that you’ll have to unnormalize later. (So the Z of .1111111 might be segment 1, etc…)
If you wanted each subpanel (aka segment) to render the same panel, just calculate using X and Y and ignore the Z, and they’d all do the same display, assuming time/etc are all equal.
BTW, thank you for asking this, I hadn’t thought of this use for “the third dimension” but it absolutely works well. Another strength of PB’s flexible mapping.
If this isn’t clear, happy to write a demo for it.
A common use case might be a led covered cube: 6 sides. You could choose to have a pattern that displays on all sides the same pattern, displays mirrored versions (or rotate) each face, but otherwise draw the same on each, or treats the 6 as a single matrix.
This can be done by making a copy of each pattern, and having one copy use the entire coordinate space, and another copy repeating itself 3x in each dimension.
Lets take this example, a simple rainbow drawn diagonally the display:
//copy this var along with a few lines in the render2D function to
//make patterns repeat.
var multiplier = 1 //number of copies in each direction
export function beforeRender(delta) {
t1 = time(.1)
}
export function render2D(index, x, y) {
//the next 4 lines can be added to any render2D to create repeated patterns
if (multiplier != 1) {
x = (x*multiplier) % 1
y = (y*multiplier) % 1
}
h = t1 + (x + y) * .5
s = 1
v = 1
hsv(h, s, v)
}