Hi @Kamehana,
Is there a faster or more efficient way of doing this other than painstakingly adding each pixel with greater care and precision, or manually entering the coordinates?
Not at this time with a construction like yours and the tool as it exists today. If your LED layout were regular (like square, or followed some pattern), some code could generate the map.
The image pixel mapper tool was a quick project. In an ideal tool you could draw lines, snap to a grid, drag and drop points, etc., but the tool does not support those things now.
The recent enhancement I just uploaded will let you work with lower resolution images, which then naturally “snap” to pixel rows/columns.
That said, what you have is still quite close, and would look good with most 2D patterns.
1: What is the function of the SAVE button at the bottom of the Mapper page?
Once you paste the map in Pixelblaze, it will be used immediately much like editing a pattern. Both the preview on the right and the in-memory pixel map used for rendering are updated. Click Save to make this change permanent (and overwrite any previously saved pixel map). Otherwise your pixel map will not persist if you close the page and restart PB. This will store both the normalized pixel map used internally, as well as the text for your map.
2: How can I save and reload my coordinates other than in a text document?
The JSON text is a portable format for your coordinates. When you click save this is persisted on PB, and you can also save this elsewhere, like in a text file on your computer for safe keeping or to use later with other PBs. These coordinates can also be loaded and transformed using just about any programming language since JSON is a widely supported syntax.
3: How can I take PB Saved Patterns and modify them to run on my 2D mapping coordinates?
On the Mapper tab, scroll down to view the documentation for the mapper tool and how these work with Pixelblaze pattern code. You can also access that documentation here.
Once a 2D pixel map is installed on the Mapper tab, patterns can implement a render2D(index, x, y) exported function.
A super easy trick to convert a plain old render() pattern is to swap out any code that uses the expression index/pixelCount with x or y.
For example take the default rainbow pattern:
export function beforeRender(delta) {
t1 = time(.1)
}
export function render(index) {
h = t1 + index/pixelCount
s = 1
v = 1
hsv(h, s, v)
}
To convert this, the render function is modified to become render2D with additional arguments, and the index/pixelCount is replaced with x:
export function beforeRender(delta) {
t1 = time(.1)
}
export function render2D(index, x, y) {
h = t1 + x
s = 1
v = 1
hsv(h, s, v)
}
This will cause a rainbow to sweep to the right on any pixel mapped LEDs, and the best part is that the now 2D pattern works on any LEDs that have a 2D mapping. It would work equally well on a square matrix as on your orc LED suit.
There are many patterns on the pattern sharing site with 2D and/or 3D support!
I think “fast pulse 3d” would look really good, give it a try!