Wanted to come back to this, especially since I was playing with @Sunandmooncouture 's map last night.
Because @wizard’s transformation API includes 3D rotation, you can essentially swap any axes for others. So let’s say your led build has something complex, using the mask as a real world example.
Making the Z axis run essentially horizontal thru the mask makes the mapping simple, but many existing patterns might look better if for example, the X axis was the horizontal axis.
Yes, you could remap everything by changing the mapping code to put the X values where the Z values.are, etc.
Or you could rewrite the render3D to swap x and z values…
Or you could just do a transformation API rotate, and boom, in one or two commands (hint: rotate on the y axis, a 90 degree change will swap X and Z) the entire map is reoriented.
In fact, it’s a good argument why you want all of your axes to be in the same units. So a polar coordinate map fails this, as R is distance and A is an angle. A cylindrical adds Z as a distance, so swapping R and Z is possible (unsure if a rotation can do this, but I’d suspect yes)
A spherical coordinate system has the opposite problem, R plus 2 angles.
I need to build a model of a sphere and a cylinder to play with these, now.
But anyway, if you put XYZ coordinates into a map, you can essentially rotate so whichever axis you want (say horizontal along the mask) is where you want it .. so a given pattern does the right thing. So taking a sound reactive pattern which normally does the spectrometer along the X-axis, and the volume/ bar height on the Y… If you wanted the bars to run along the Z, you could easily rotate it with one line, no pattern rewrites needed.
@wizard, consider adding a polar<->cartesian conversion into the API? That would allow rotation in any direction, as well as avoiding the userspace conversion. (to be clearer, you’d have to take 2 axes, one distance and one angle, and convert to 2 distance) which would solve the cylinder issue. (Still pondering the spherical issue… I thought it would require 4d, and it might)